adding migration file for email
adding email resource
adding phunit
some restructuring