initial implementation

needs work with timing - RectHV called too many times in KdTree, and
nearest() methods needs improvement