Neaten up code somewhat; add IMinimizer

Add IMinimizer interface so that same curve fitting approach can be used
for any function minimization algorithm.