Python3 compatibility

Python >=3.0 *and* >=2.6 compatibility.
I tested both, and did the patch so that it remains python2.6 compatible, but I encourage you to do some tests on python >=2.6 before merging ; my personal use being on python 3.