Make test runner less chatty.

This is a fix for issue #528. It pulls the line printing out of build.cc (which is a good change even if you don't like the rest of the patch as build.cc does too much, and the code this pull request pulls out is relatively self-contained) and uses that to print a custom test printer.

If you read this commit-by-commit it should be relatively easy to follow, but I can slice it up into nicer and smaller commits too if you want.