Refactor email into a module and add support for Google App Engine and SendGrid