Use the newer more generic sampling and interpolation functions
developed recently instead of the `CurveEval` type. Functions are split
up a bit more internally, to allow a separate mode for supplying the
curve index directly in the future (T92474).
In one basic test, the performance seems mostly unchanged from 3.1.
TODO:
- Optimize for single curve index
- Fix sorting not accounted for properly