a 2D bounding box kd-tree originally written for Oct-Tools back in the 80's, with various improvements by me.