Moved ensure_directory_exists to eglib.