Sessions complete, login/logoff complete. Major refactoring.