Improve canonicalizeHtml tests, fix on IE8.

* canonicalizeHtml now replaces all whitespace sequences with a
  single space. (note that is is overly aggressive for attribute values
  but that's probably ok)

* Replace ad-hoc test helpers in many cases with
  canonicalizeHtml.

* Fix tests on IE8.