-Move some code to separate files
-Some cleanup, commenting, and renaming
-Fix issue with loading a previous date