Add Repository#ahead_behind.

I hate the method name, so if someone has a better idea, I'd be pleased.

Everything else should be good 2 go, so @vmg, please apply your merge-magic.