Move Emailing to Class

Create class LogMailer which handles sending the status email.
Fix some PyLint Errors

Fix a few PyLint errors around exceptions and using built in types.