don't use fileinput loop

there are issues where the state of a previous file will not get
reset correctly if we implicitly use the fileinput loop. To avoid
this break the looping over the file list out one level.

We also need to change the tests as this now requires that we always
send down an array instead of a string.

Change-Id: I781c1b642eb15fc7e2914791d5b77e8a4752db79