Adds mailer functionality and a suite of tests