Finds connected components on 2D grids for testing reachability between two
points, with fast updates when changing reachability (e.g. on one machine it
was typically 0.2ms w/ 1024x1024 grid). Each grid square must be “open” or
“closed” (traversable or untraversable), and grid squares are only connected to
their orthogonal neighbors, not diagonally.