CMakeLists.txt : Generate tests/test_wrapper.sh during configure.

Plus other minor cleanups.