Spatial index

I'd like to get this back to master and continue to work on it from there. It can't be rebased because I've pushed and @cfarmer has based commits on it. And I think it's not going to be a smooth merge because I've got 739d04e in the spatial_index branch's history. There's no sign of that code in the next version, 0ee9f4d.

@kjordahl I've never run into this before. Will we need to remove 739d04e from the spatial_index branch's history?