Refactored user and session management into manager classes.