Maps an index into the range [0, length) by subtracting length repeatedly.
References length, SYTEN_ASSERT, and SYTEN_ASSERT_DEBUG.