Clean spline basis code.
Add segment finder as module helper function.