Massive rewrite
Compiles post refactoring
Modularization complete