Used TextNodes to protect against XSS

This time I set coding style to use tabs in WebStorm.
It's still gone and Linted a few of the lines. I'll let these stand in
this diff.
Merge pull request #2 from Pennine-View-Harrogate/useTextNodesToPreventXSS

Used TextNodes to protect against XSS
Syncing MASTER to upstream