Minor code cleanups. Restoring Py3

Imports reordering and cleanups
Restore Python 3 compat

Fix #133