ensure portability to python 3

some extra modules wouldn't run at all under py3, those should fix the most glaring problems, but maybe a 2to3 run would be in order as well.