Improve test output checks. Add dev dependencies to test fixture.
Fix error handling on sort-* and upgrade-* commands.