Use LineNumberReader.
Regularize the various output file names a little.
Clean up imports.
Use LineNumberReader.