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 to go, so @vmg, please apply your merge-magic.