Making the emailer better-er & covering with tests

mostly so that it can deal with url encoded auth, as can be the case
with heroku email addon vars.