The midpoint calculation is almost done

It appears that it differs from figtree's midpoint rooting by one
branch. That should be resolvable without too much trouble.