some changes
Added tests. Added send email functionality.