Convert CCompactSize to proper formatter
Summary:
Serialization improvements step 5 (blockencodings)
This PR is probably the most involved change in the sequence of changes extracted from #10785.
In order to implement the differential encoding of BIP152, this change changes VectorFormatter to permit a stateful sub-formatter, which is then used by DifferenceFormatter. A CustomUintFormatter is added as well to do the 48-bit serialization of short ids.
This is a backport of Core PR18112 [1/5]
https://github.com/bitcoin/bitcoin/pull/18112/commits/3ca574cef0b4423f21b2c3efd8f5c9f71d52f219
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D8786