Added first derivative residual calculations. What type of residual is used can be changed in the settings file.
Re-enabled plotting of residuals patterns and added plotting of first derivative & residual patterns.