Normalize DOM tree before comparing

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