Mod: add py3k support

Tested under Python3.3 and works fine.

Ideally, we should use unicode internally, and convert to required type when needed. But that would introduce more changes than my patch.