Update serialization to use parse5

This should enable us to remove a lot of the cruft we currently have to
care about when serializing and move the workload to someone else.
Fix up some invalid tests

Doctype behaviour tests were tested in Chrome console.