Convert most source files to C++ and make sure they compile correctly (now use g++ by default)