gaussianfit.py rewritten as a class with changes suggested by Pavol