Refactor the indexing code into a reader and writer.
Move serialization code into a separate module.
Add a setup.py so that the package can be installed.
Save hashes of files only if success in parsing.