Refactored session code to session manager module

Created a session_manager module that will handle the details of
creating and validating sessions.