C++ server code

Latest master merged in. We should discuss the layout of the code.
will they affect development at all or are they just edge cases?