Technically this isn't quite right, as the full list of files is not
available to the go parser (some files are filtered out too early in
the process), but it should do the job for now.
Sadly, iterating twice won't work, as this will create directory
associations in the wrong direction, and there's no way mappings
let you iterate backwards. Let's mark the entries as directories
and then swap them out with the directories when building a zdir
tree instead.