C++ server code

Latest master merged in. We should discuss the layout of the code.
In theory that is to make sure that whatever tokens we get aren't empty.