Implemented terminate session, allowing to cleanly close a session
Fixed bugs with restarting as host after being the client
Added some comments
Implemented terminate functionallity

Merge branch 'terminate' into dev