The update to nodemailer requires different initialization.

@seanmonstar - would you mind reviewing this? The recent update to the nodemailer version required the mailer to be set up differently. While I was poking in the emailer code, I refactored things to be a bit more structured/understandable.

I also did a refactor while I am at it to clean up the code.

An ephemeral instance is set up: https://send-email.personatest.org

fixes #4000