Make ISplineFromR a function and reduce LOCs.
Remove some unnecessary cases in ISpline calculation.
Throw out some rather confusing variables.