Added manual single/mass email sending ability. Refactored email functions.