Implement UserMixin.

User collection and its functionality can be used in several
controllers, and for reusability they should be separated into an
independent mixin.
Implement user login handler.

Until now a user's password hasn't been checked for login. This patch
implements the login functionality including checking a username and
password, and a testcase for it.

Now implementing the testcase...