python 3 compatibility

The initial commit only lets the configure and build part pass. There is much more needed to be Python 3 compatible at runtime.