Handle rebases and stashes properly

During a rebase, a few things are different:

 * "ours" and "theirs" are actually flipped, confusingly.
 * Conflict markers use snippets of the commit message rather than a ref. (This happens in a few other situations, actually).
 * After all conflicts are resolved, `git rebase --continue` should be used instead of `git commit`.

Detect when a rebase is in progress and adjust behavior accordingly. This should fix #37 while I'm at it.