Updated setup.py to be compatible with python3 and automatically run 2to3 during build on 3.x systems. Modified C module source to work with python3 and fixed various bugs and warnings