implement difficulty hardfork
This is the long-awaited difficulty hardfork that has been holding back the v1.3.0 betas. Please do not merge until I've had time to write more tests and go over this with a fine toothed comb.
The design and algorithm are tested, simulated, and well thought through, including edge cases and adversarial situations. The design itself should be ready to rock, it's more a question of whether the implementation matches the design or if there's some egregious mistake somewhere.