Write index without burning memory
This is an idea to write the index in a way that is more memory efficient by:
- Avoiding holding large IndexNode, DirectoryNode, and nested List structures in memory.
- Reducing GC pressure since lists are discarded after each directory.