Add testing of hierarchical likelihood using expectation values of samples
The adds test code to include the version of the hierarchical analysis that uses samples and calculates expectation values. It doesn't check that the method is correct and valid(!), but just checks that it works!
This PR also stops the samples being stored if they are not required (i.e., if not using the expectation value method), and can downsample the posterior samples too.