Add an utility to convert string of bits from base 2^N to 2^M .
Summary:
This is extracted from D544 .
based on code from Pieter Wuille.
Test Plan: Added unit tests.
Reviewers: dagurval, #bitcoin_abc, tomtomtom7
Reviewed By: dagurval, #bitcoin_abc, tomtomtom7
Differential Revision: https://reviews.bitcoinabc.org/D572