A bunch of Python3 porting, but still not quite ready.