Email aggregation

Submitting simong's work for email aggregation in a PR.

I haven't looked into this yet and will iterate over it a couple of times before reassigning for review.