C++ server code

Latest master merged in. We should discuss the layout of the code.
@gemarcano is this file supposed to have a `.hpp` extension or `.cpp`?