a port for python3

hi!

i've ported the module to python3. feel free to add #ifdefs and stuff if you'd like to retain python2 compatibility.

sincerely,
Radek Podgorny