Improve submodule cache management

This is a collection of fixes that I've worked at on and off over the past few months. I decided to finally try to extract and rebase the pieces that could to move some of this forward.

The goal here is to fix the submodule caching. This mostly tries to make reloading the cache smarter by keeping the timestamps, etc. of the sources of submodule data. This should make a reload faster because unchanged data will not have to be reloaded. As a result, this should make it useful to reload much more frequently so that diffs and status, etc., don't use out of date data.

By adding an actual `git_submodule_cache` object, there are a number of other improvements that can be made, including some smarter behavior in a threaded environment. That aspect of things still isn't perfect, but should be improved.

- [x] rebase old commits
- [x] add `git_submodule_cache`
- [x] add basic data for tracking cache data source updates
- [x] hook up basic checks for cache data source changes
- [x] make sure all tests work
- [x] add test for the various cache data source invalidation cases
- [x] use the cache mutex during cache data updates