redux of the files-test branch

I hopelessly muddled the previous pull request. At some point I will read up on git.