Move non-standard serialization methods out of document

See #141.

We still have to leave in the .innerHTML setter for now since it's
basically used everywhere in the code base for parsing the document.
Fix failing tests to use new serialization method