A reworked version of this patchset which hopefully addresses all of Patricks remarks. Additionally, I added a couple of "complex" bisect tests in test-bisect2 since the current tests only use a linear history.