Check password when login.

Fetch the password of the given user from mongodb and check if the password is
correct.
Sort imports alphabetically.
Move Authenticated to beyond package.
Add a test case for successful logout.
Merge branch 'master', remote branch 'origin' into jmaster