Email login

Merging into master, end of iteration 2