search::KdTree accepts different types of KdTree

Now search::KdTree can be used with different KdTree implementations.