Fix issues with innerHTML in plaintext like elements

This also cleans up innerHTML escaping for attributes, text nodes
and comments.

Fixes #347