C++ server code

Latest master merged in. We should discuss the layout of the code.
does the server stop if there isnt a connection?