made it work for Python 3.x (broke 2.x support)

I've tested enough to verify examples work, etc.