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.