fixed: adapt to CpGrid API change

probe is necessary as API change was unversioned
Refactors to prepare for multithreading.

Rewrites a very C-esque routine to a more value oriented function. Functionally
equivalent, but now exposes decent opportunities for thread-level parallelism.