Normalize DOM tree before comparing

Remove irrelevant content from the DOM tree before comparing it.

Removes:
* comments
* empty text node.
* single trailing `br` elements
* `\uFEFF`—invisible space