Fit framework is now fully mode independent.
Tidy up fitting script.