Refacotor for usage with new persistence container functionality

* Add method to set session ID
* Use StreamSocket of webserver instead to Socket/Client