Split out automailer into a service, fixed issue inserting an entity in EF, and refactored repository