Implemented a new wavelength fit function that seems to work better than the existing one, and which can automatically penalize large wavelength changes. This is not a stable commit, as I am not sure if it works in a full-scale fit!