Fix TimedItem modulus helpers to handle negative values

Have confirmed the updates to test-iteration-start.html