Mod: add compatible wrappers and fixes for Py3k

Tested on Python2.7 and Python3.3