Adding login support.
Fixed merge changes.
Worked further on the login / logout logic.