Add more C++ tests (rebased onto develop)



This is the same as gh-963 but rebased onto develop.

----

The rest of my changes to improve unit and integration test coverage