Py3 support

All tests pass on Py2.5, 2.6, 2.7, 3.2 and 3.3. Everything seems to work properly at this point.