Fix checks which return list of lines

cdc4c20a introduced a change that didn't properly handle the display of
checks which returned a list of lines. Instead of returning each element
of the list on its own line as originally intended, it would display the
literal list contents e.g. `["line 1", "line 2", ...]`.

This corrects the issue by Array-izing and flattening the output. For
nil or empty output, this will continue to return an empty string. For
lists, it will return that output properly converted to a string with
newlines as necessary. For any other output, it will return the original
string.

Change-Id: Id62190835e9a7dd35c58d3807361b677fd594381
Reviewed-on: https://gerrit.causes.com/25542
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Fix file type filtering for staged files

Commit ce42f5a introduced a bug through the use of `ends_with?` instead
of `end_with?` and referencing a non-existent `filetypes` attribute.

This change corrects the use of `end_with?` and renames the class
`filetype` attribute to `filetypes` to reduce confusion, since it
technically contains an array of extensions instead of a single file
type now.

Change-Id: Ief7df9f925f19308873a39a464e6a355a2ffb07f
Reviewed-on: https://gerrit.causes.com/25555
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Aaron Neyer <aaron.neyer@causes.com>