Implementing almost all of Document.normalizeDocument().

This follows the rules specified by DOMConfiguration. In particular:
 - replacing CDATA nodes with text
 - splitting CDATA nodes
 - merging text nodes
 - stripping comments
 - detecting invalid characters

I haven't added the normalization code for XML validation or namespaces.
10 files changed