Python 3 support

This seems to work in Python 3, but it forced me to use the built-in json library (which I still alias to jsonlib for clarity). I did try to use jsonlib-python3 conditionally, as the commits will show, but thanks to a bug in distutils, jsonlib-python3 is impossible to use as an install requirement.

Let me know if you can think of any alternatives, if you feel that the stock json module is unnecessarily slow (it's worked well for me in the past, but I wasn't doing anything high-performance with it, which you might be doing with dogfood).