metadata directory support

- incidentally adds defensive driving against null version
  in method `destination_path`
Merge pull request #6117 from rolandwalker/metadata_directories

Metadata directory support