Add enough #ifdef's that tests pass under Python 3
Get Python 2 version working again
Merge branch 'feature/combined-2-3'