MNT: Remove duplicated code across `CostFxn` classes
Many functions are duplicated across the various CostFxn
classes. This MR proposes a new CostFxnSplineUtils
module which contains a collection of stand-alone functions for performing calculations on sparse diagonal matrices.