Extract database calls for aggregate service
Test aggregate_logs service
Clean up Database helper

- Removed a SELECT query that was run twice
- Added a required file (for String#squish)
Add tests for Database helper

Finally -- tests for all those SELECT queries.
Fix timezone bug in database helper

`Sequel.timezone = :utc` says that the database is currently set to UTC,
meaning that if you specify a timestamp without a time zone, it will be
interpreted at UTC. This is not the case (unless server time is UTC)
unless we also call "SET TIME ZONE 'UTC'". This commit updated all
'Time.now' calls to use UTC as well, although that isn't strictly
necessary.