[git/alternates] Wrap interactions with git alternates
[git/working_dir] (GH-137) Update remotes and alternates

Commit 3b9b3926 introduced a regression where the actual git remotes
were not inspected and the remote would always behave like it was in
sync. This meant that when a git module was switched from one remote to
another that change would not persist to the system. In addition the git
object alternates was not updated with the new cache, so the new repo
could start accumulating git objects unnecessarily.

This commit updates the working dir to inspect the git remotes for
'origin' and 'cache' to make sure they are set to the expected values,
and will update them as necessary when they are not properly set. Since
changing the origin remote means the cache is also updated the remotes
are always updated in pairs.
Merge branch 'issue/1.2.x/gh-137-update-git-alternates' into 1.2.x
[git/working_dir] (GH-163) delete tags when changing remotes

Tags are not namespaced and are not overwritten by default, so when a
git repository remote is swapped out the tags from the old remote may
linger and could collide with the new tags. This commit changes the
remote update logic to purge all local tags when the remotes are swapped
out.
Merge branch 'issue/1.2.x/gh-163-delete-stale-tags' into 1.2.x
Merge branch '1.2.x' into 1.3.x
Merge branch '1.3.x'