Improve test coverage

Also included:
* rename db column to event_created_at
* assorted refactoringzzzzz