More refactoring and also some cheating.
Extract FileInspector class.

This refactoring was proposed in #610. I went ahead and did it.