MAINT: refactoring CurveFitter to have f, x, y, p, making it similar to scipy.optimize.curve_fit