protocol/bc: refactor common witness serialization
protocol/bc: refactor common witness serialization

Part of #349. Preparing for transactions with non-empty common witness

Closes #414

chain/chain,chain/chain,chain/chain,chain/chain,chain/chain,chain/chain