various changes, mostly login/logout functionality