preliminary python 3 porting work (most tests pass)

might serve as basis for a serious effort. some tests were disabled due to the fact that python3 doesn't have meaningful byte literals inside strings any more.