Add getNearestRowIndexForTime() utility and reduce code duplication.
Add getNearestRowIndexForTime() utility and reduce code duplication.

opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core