PEP 3143 implementation with focus on python 3.3/3.4

except for the Unit tests, the code should also run on python 2.x 3.x