Fix for issue-1340

Added line to require cgi (http://www.ruby-doc.org/stdlib-1.9.3/libdoc/cgi/rdoc/CGI.html) which has a CGI.escapeHTML method that changes strings with "<" and ">" to "&lt" and "&gt" respectively.

Only escaping the characters when about to render submitted code on screen, this should not affect binary files.