Difficulty retarget fix

Fix an issue with the difficulty retarget where it is using only the
last 48 blocks to determine where the next difficulty will should be.
The previous system can lead to difficulty swings of the maximum
variance in the event a miner puts a lot of hash power onboard only in
the times when the difficulty is low.

As from block 62400 the difficulty algorithm will work out the block
time average from the last 12 retarget intervals (576 blocks). This
should be the equivalent of 24 hours worth of blocks when the network is
running efficiently.