Move C++ code out of the C headers and into either C++ headers