Moved email related code to a separate folder

Renamed some classes and moved the code in preparation for a big
refactoring of all email related code.