Added tests for user model, added helpers for authentication.