Add spatial index

Add a spatial index to accelerate the nearest-neighbor queries.

See "Optimized Spatial Hashing for Collision Detection of Deformable Objects"
and "Efficient Neighbor Search for Particle-based Fluids" for details.

Need to figure out what's causing the two "boils" along the bottom.