Improved performance of splitting.

Potential intersections are now partitioned as the splits are
traversed, which means that only the relevant potential intersections
have to be dealt with at any level of splitting.