Cleanup imports

Remove a lot of unused imports, and use absolute import paths rather than relative import paths in many places.  This reduces risk of name collision and should make it easier to make a proper package that may be installed.