Factor submodule files function into executable

Unfortunately we have to use an external script for `git submodule foreach'
because versions prior to ~ 2.0 use `eval' to execute the argument.
This somehow messes quite badly with string substitution.
Fix git version detection bug for skipping a test