Changes and cleanup inspired by a move from g++ to clang.

Don't actually switch to clang++ yet, since there is an outstanding
bug with the pstreams package on ubuntu, which is at 0.7.0 whilst
0.7.2 is required for clang++ support.

https://bugs.launchpad.net/ubuntu/+source/pstreams/+bug/1264341
Add extra validation in some end-to-end tests.