More cleanup; adding unit tests for TallyEvent