Sort and update imports in all scripts/modules
This PR sorts and updates the imports blocks in all modules and scripts so that:
- imports are grouped in ordered based on the dependency chain
- imports in each group are alphabetically ordered
- imports using
six
have been updated to use the Python 3 module names - unused imports have been removed
Edited by Robert Bruntz