(Email aggregation) Review follow-up

* When marking your notifications as read, no emails will be sent out for previous activities
* Spliced of activity/email bucketing logic into it's own module
* Various clean-up + added tests
* Exposed activity view adapter through the UI api
* Cleaner UI template util functions