Add a sanity check to avoid divide by zero crashes in set_target
Avoid the extra generation of a byte flipped hash2 in struct work and directly use the LE work hash.
Abstract out conversion of a 256 bit endian number to a double, correcting errors and use it for determining any magnitude share diff.