Factor bits to target conversion
Summary:
This diff introduces a new BNitsToTarget facility which avoids code duplication and can be used for heartbeat.
There is no change in behavior.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D16574