Checkpointing. Completely broken.
Cleanup and refactoring continued. Still broken.