Test git_submodule_add_setup with relative url
git_submodule_resolve_url supports relative urls

The base for the relative urls is determined as follows, with descending
priority:

- remote url of HEAD's remote tracking branch
- remote "origin"
- workdir

This follows git.git behaviour
Minor code cleanup
Test (and fix) the git_submodule_sync changes

I wrote this stuff a while ago and forgot to write tests.  Wanted
to do so now to wrap up the PR and immediately found problems.