Add file_lists cache for gitfs (2014.1 branch)

**THIS PULL REQUEST IS AGAINST 2014.1**

This pull req backports ports #9747 for gitfs, since the pygit2 stuff would not merge cleanly into the 2014.1 branch.