Adds Branch and Commit support.
Sorry for the big diff.