Code from branch 'api_quality'. Adds fitting of the pulseheight
distribution. This is called from jobs.py.
Changed output directory of the fit result.