minimize use of "from module import *"

This statement was causing strange bugs because of namespace pollution. The
order of imports mattered because later "from module import *" statements would
overwrite modules imported earlier. Transitive imports also made it difficult
to figure out where an identifier was being imported.

This statement is still allowed in test code since nothing else should be
importing it.