move moment calculation to histogram, add cpp tests
adapt record energy histogram action