Add leaf tests.

Also fix a bug in line segment intersection with coincident endpoints.
Consistent bounding box computation.