Playback fixes
Refactor server code

Move most of the session related code to SessionState class, where it belongs.
Separate login handling to its own class.
Change login handshake to something that can later be easily extended to support multiple sessions.