Abstract out the rebuilding of hash2 in work.
Allow arbitrary diffs to be tested against nonces via a test_nonce_diff function.