Build tests with cmake, and run them in their own tmp dirs.
Merge pull request #235 from cgjones/test-changes

Build tests with cmake, and run them in their own tmp dirs.