Some sanitisation

This is a patch that addresses some of the worst XSS vulns, it is obviously incomplete.

Will now close #551