A first bit of cleanup for mm

- some structuring of the macro code
- fixed samples plot
- fixed color scheme of samples plot and of prefit plot