Initial version of KdTree-based extension is working.