Improve c++ unit test harness

This substantially reduces the boilerplate for adding a new c++ unit test.