Update code throughout linterReporter for better style and performance.

Mostly fixes from previous PRs of mine. Some (seemingly) better comments and ways of doing things.

@MiguelCastillo: I'll add comments on the lines where I want to better document why the change was done. (**Edit**: Finished adding comments).
I am not sure I understand the reason to remove it. Is it that you don't think it is costly enough to call possibly 50 times in a single pass?