Make w3c test framework more flexible

This makes it more simmiliar to the w3c test runner, although it is restricted to test harness tests.

Also improves debugging messages a bit and makes the test util more robust.
I really preferred the way this file was before: simple, hackable, easy to read. Now it has a bunch of logic and implementation details in it. Can those be moved into ./w3ctest.js?