normalize git URLs when caching (fixes #7009)

Offloads the bulk of the normalization to a new module dedicated to the
purpose, which will allow us to do a better job over time of not
duplicating Git remotes unless necessary.