OOIION-1829 - Adds proper handling for gradient test and mindx sequences R2

- Updates C code (with better comments too)
- Adds new tests in both python unit tests and C extension tests
- Verifies intended functionality