Refactor Diffie-Hellman commonalities and remove the Java construct for DHGroup.