Add support for recording events

Summary:
- Basic model to support various types of events
- Record email event as part of mail listener
- Only email once per build failure

Reviewers: cf, nipunn, mattr

Reviewed By: mattr

Differential Revision: https://tails.corp.dropbox.com/D43970