Report test failures to the test server

This helps debugging on devices which have a crippled or nonexistent
JavaScript console. Each test failure or exception is reported to the
test server, which displays them on STDOUT.

If a stack trace is available (depends on the browser), it will be
displayed as well.

A new debugging helper is available: `t.debug(obj)`. It logs the string
representation of `obj` to the server.