A general statistical mechanical approach for modeling redox thermodynamics: the reaction and reorganization free energies