Class handling non-linear least squares fitting of 2d datasets