Factor out the C++ RPC server code into it's own class.