Add DieHarder; refactor GCD and SetGCD

Move SetGCD and SetMax functions to GCD so that DieHarder can use them.
Unit tests pass.