rollback undesired changes per feedback

- remove module-level docstring
  (but? pep-257, "All modules should normally have docstrings" ??)
- try to restore original import ordering
  (unused imports remain removed)
- restore deep import of os environ, isatty
- restore "caching doesn't work" scrap code