Clean up unused imports
Replace "import *" with explicit imports

In passing, fix a couple of bugs that this uncovered.
Remove unused code and fix bugs uncovered by explicit importing