Cleanup
Moved master dictionary iteration out to main, more information for the compiler about function arguments
Support for resuming after crash, restart, etc