py3k fixes

fixes for py3k

I introduced a dependency on six but I guess it could be backported to compat3.py

I also switched to relative imports