Rewrite spec-example tests as testharness.js tests

Because of small differences in the way browser engines do math and
layout, it is very hard to come up with a reftest that renders the same
in all browsers. Switching to a testharness test with fuzziness allows
the tests to be much more robust.