Added new set of tests, cleaned up sessions

We have tests to make sure appropriate links are there for logged
in and logged out users.

Also we have cleaned up sessions.

Added links to application template
Refactored the user controller

Refactored some of the logic from user controller to user controller
mixins.
Refactored roles.

Moved some of the core logic of roles into the mixins.