Move sending mail into mailer class
Refactor features (with thanks to andrewn)