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 feel like it is a useless optimization, yes. I don't feel too strongly about it though, so if you think we should keep it, that's fine with me.