Put all python 3 vs 2 differences in one if.
Make unicode and unichr work in python 3.
Make all tests pass in python 2 and 3.
Use html.escape instead of cgi.escape in python 3.