various refactorings, and fixed mappings to be in correct order (git_commit, hg_changeset) since they were the wrong way around everywhere!