Switch from cgi.escape to html.escape (the former is deprecated in Python 3.3).