Compile under CPP target

Make the API available through CPP target, allowing users to set up a C++ based server.

Please review carefully since it involves a lot of files.