Update kdtree from master branch. Supposedly faster on large grids.