Refactor User.find_by_username_or_email

* Improve test coverage
Merge pull request #1345 from salbertson/refactor-find_by_username_or_email

Improve test coverage and refactor User.find_by_username_or_email