Fixes r=peterbe
* Factor out classes for a more concise Mock
* Consolidate truncation of tables into one statement
* Cleanup datetime related function calls
* Make variable substitution in SQL nicer to read
* Import spacing and better description for cron job