backends/git: Update remote url instead of cloning again

There is no need to throw away all the commits that we already have.
backends/git: Added find_ref() and ref_exists() methods

Make sure to reset to the right revision (i.e. origin/master, not master)
backends/git: Merge update() and checkout() code

... and fix submodule handling in the process.

Submodules can only be updated once the parent repo and working dir is in
the right state. So before the "git submodule" commands are run, we need
to "git reset" the repo to the requested revision.
backends/git: Simplified remote URL updates

We can simply set the remote URL before each fetch to make sure we always
use the right URL.
backends/git: Use "git checkout" instead of "git reset"

We can working with a detached HEAD instead of moving the master branch
around
backends/git: Added 'origin/' prefix fast path to find_ref() method
backends/git: Use "--force" for submodule updates

Make sure the working dir is definitely updated with any changes