Fix bugs stemming from improper html sanitization

The db_grader_proxy originally did not properly escape some HTML entities - such as '&' - which were received from the grader within the html generated as feedback for the student. To rememdy this, I cleaned up the html formatting code to cleanly sanitize the html recieved from the grader. This includes proper html escaping, making sure all tags are properly closed, and formatted in the way the application server expects the feedback to be formatted.
I've also written some unit tests to test the sanitization process, cleaned up some of the existing code, and added some documentation.