Add methods for writing pre-escaped strings

- Fix doulbe-escape in writeElementString().
- Add optional argument to writeElementString() for writing pre-escaped HTML.
Preserve whitespace in serialize/parse round-trip