Fixes ctrl+c bug if socket-thread is still alive
Removes ugly singleton which formally stored the connected clients and cleans up the code