C++ server code

Latest master merged in. We should discuss the layout of the code.
the line after is indented one more than the next set of lines, seems they should all be on the same indentation level. At the top of each file you can show/hide comments with the checkbox (its hard to see the code with all the comments).