Refactoring of auth to support emails as usernames
Merge commit 'a20c59c'