Do some refactoring in pow.cpp to make it easier to introduce new difficulty adjustement algorithm.
Do some refactoring in pow.cpp to make it easier to introduce new difficulty adjustement algorithm.

Summary: As per title.

Test Plan:
  make check

Reviewers: freetrader, schancel, sickpig, dagurval, #bitcoin_abc

Reviewed By: schancel, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D569

Bitcoin-com/BUcash,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Bitcoin-com/BUcash,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Bitcoin-com/BUcash,BitcoinUnlimited/BitcoinUnlimited,Bitcoin-com/BUcash,Justaphf/BitcoinUnlimited,Bitcoin-com/BUcash,Bitcoin-com/BUcash,Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited