extract synchronize_cache_repo method in git_repo.rb

Brings kochiku-worker closer to the git_repo.rb in kochiku.
Mimic the submodule redirect logic in kochiku repo
Merge pull request #10 from square/rob/smarter-submodules-kw

Selectively redirect submodules to the cached repo