Improved text handling

Improve the handling of text, this yeilds better pretty printing of
generated HTML.  Text is merged where possible.  Coalescing of text
is supported when parsing XML, and preformatting is supported.  Also
fixing irrating text / element ordering bugs.