Enable email login with custom user model.
Merge pull request #350 from benkonrath/email-login-2

Second attempt at email login with custom user model.