Added decorator that checks for output list length.

This way that logic is isolated in one place, and doesn't get repeated
in every "get_*_files" function.
pep8 fixes.