[VFS] Fix root directory handling in YAMLVFSWriter
- refactor JSONWriter::write
- handle directories uniformly - don't skip writeEntry only for the first Entry
- handle entries without a parent directory
- assert every entry have either a parent dir or is root directory
The testcase previously vioated assert in JSONWriter::containedPart about a previous directory element path being non-empty.
Not happy with the name - open to suggestions.