Reorganized code responsible for combining p-values.