Test updates

updates to the c++ tests and some minor cleanup of the c++ source files.