Add parse_path_metadata() and PATH_METADATA

The former is a simple refactoring to make the latter easier.