Issue #277: Allow users to log in with usernames or e-mail addresses.

PR for https://github.com/backdrop/backdrop-issues/issues/277

Replaces https://github.com/backdrop/backdrop/pull/398