Python 2&3 support

Imports updated for python 2 and 3 support.  Also code cleanups.