Added tests and fixed CIF metadata propagation in data reduction routines