Import rework

This cleans up the head of the script, removing unused imports, making "os" import absolute, and sorting them in the pythonic way (using newly discovered tool, 'isort'). Also added simple head docstring as discovered in @mattswe's backport, probably a good idea for discovery.

No actual behavior changes occur with this change.