Add 2to3 support for py2 compatibility