VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files

This moves the logic to write a JSON VFS mapping from the C api into
VirtualFileSystem, so that we can use it internally.

No functional change.