Tidied up user session management in TAL, made a singleton User model module to store the user_id for API access purposes