Bug fix: Sorted outputs would sort individual characters instead of lines.
Make unit test use a relative path to access bin/diagnose_imports.

Needed for the Travis tests, which aren't set up to run inside the
install dir for some reason nobody bothered to explain.