Encapsulate iteration over just the array arguments of a function.

We were already doing this in several places, but with cloned copies
of the code for doing it.  Now we have it nicely packaged up for easy
reuse.