Add an optional --logfile argument to std::test::test_main and to compiletest. Use this features and the new 'check-summary.py' script to summarise all the tests performed by the 'check' target. This is a short term fix for #2075.