Add --stats-file option, and associated test case
Handle repeated newline in exclude list