Add HTMLmailsystem class to this module and dependencies, other code structure changes