moving towards python 3 support

reorded imports while I was at it