C++ standalone: Improved efficiency of StateMonitor and DynamicArray2D