Bugfix: Fixes in calculation of macrocells

Error in calculation of centre of mass corrected and shift added for fence post problem when assigning atoms to macrocells. Also added reduction operation for correct output of macrocell demagnetisation fields.