Initial work on new mail settings
Save and use email values
Move mail specific functions and add basic test for alert emails