git update refactor

I'm not so proud of this refactor but I wanted to know your opinions.
* It doesn't use git command for revisions checkout, but it uses a tricky temporal reference (pygit2 doesn't allow to checkout revisions, just references).
* It handles tags checkout, but it also worked before, I don't understand completely how, probably with the call to `git checkout` command.
* It doesn't hard-code the origin for remote branches, but proposed implementation can be misleading with multiple origins (is it possible to have multiple origins with repoman caches?).
* I couldn't reproduce the case @magmax detected with the unexpectedly dettached head, I'd like to add a test for this and check if it's fixed.
* What I think has improved: less exception-driven execution paths, more strict tests.

Ok.