Sanitize 'filterComments' and improve readability/modularity

This function has a very high complexity.
```
rmTrailingNewline [] = []
rmTralingNewline (x:'\n':[]) = [x]
rmTralingNewline (x:xs)     = x:rmTrailingNewline xs
```

will be better.