Use html.escape rather than cgi.escape for PY3 (it's deprecated)