Refactor d3.geom.quadtree.

See #1145.