Fix crash when killing a thread that owns a mutex lock.
Rename IFitFunction to FitFunctionBase move it to separate file. Add documentation to FitFunctionBase, Chi2FitObjective.