T49 sorted version numbers

Also contains some reduction of unused import statements.

Note that this still doesn't address the wrong "sorted" versions that the install command uses.