cleanup and add preparations for ahead/behind

in git repositories the branch <=> remote-branch ahead/behind-stats now get
collected.