Address review comments.

- Sort the results immediately in inspectFile.
- Refactor the tests. Set timeout low for the tests to run faster.
- Increase timeout to 10 seconds.