Add support for "pack streams"

API layers (including a SQL layer) need to be able to pack / unpack fields individually.  This change adds a set of methods to support this.