Playing with post-processing timesheets
Factored out DB queries to make testing easier.
Separated engine from env setup
tidyup.