Fix potential vulnerability to stored XSS, and use templating for HTML
display as we should here anyway