Fixed prominent XSS vulnerabilities

At the moment Rubyric protects against little to no XSS from privileged users. This patch adds a lot of escaping to the templates, protecting against them.