Support for HTML output syntax, enabled by default

Introduced the ability to chose between HTML and XML output, and made
HTML the default. This means img tags are
output as <img>, not <img />. XML is the default when using the
XmlTreeBuilder. Control this with the
Document.OutputSettings.syntax() method.

Tightened the scope of what characters are escaped in attributes and
textnodes, to align with the spec. Also, when
using the extended escape entities map, only escape a character if the
current output charset does not support it.
This produces smaller, more legible HTML, with greated control over the
output (by setting charset and escape mode).

Fixes #322
Fixes #373
Fixes #346
Fixes #150