-broke after changing mgetPeriodRange, now expects 2D array (to organize
by iteration, then by samples). getPeriodRange(), still used on some
places, did not create 2D array from single period ID when calling
mgetPeriodRange()
-fix a number of for loops which did not explicitly declare "i",
resulting in i being potentially modified in calls to other functions
within for loop.
-broke after changing mgetPeriodRange, now expects 2D array (to organize by iteration, then by samples). getPeriodRange(), still used on some places, did not create 2D array from single period ID when calling mgetPeriodRange()
-fix a number of for loops which did not explicitly declare "i", resulting in i being potentially modified in calls to other functions within for loop.