Separate out the management of chain-agnostic block metadata from any given
CChainState instance. This allows us to avoid duplicating data like
mapBlockIndex unnecessarily for multiple chainstates.
This also adds a CChainState constructor that accepts and sets m_blockman.
Ultimately this reference will point to a BlockMan instance that
is shared across CChainStates.
This commit can be decomposed into smaller commits if necessary.
Partial backport of Core PR16194