The encoding of the structured data used in target types is quite
verbose, and most of its contents are redundant as they encode the
symbols that act as keys of the structured data fields (e.g., "layout")
as well as the self-description of the value types.
By defining an abbreviation that contains all this information as
literals, the overhead is amortized over multiple target types.
The main challenge of this change is the fact that the Array encoding
can only appear once in an abbreviation, at the end, but target types
need two arrays. Define a new ExtArray encoding that avoids this
limitation. Since the encoding space for the encoding itself is rather
tight (3 bits), this extended array encoding allows tuples inside of
arrays as a precautionary extension. This feature is not used at this
time, but it seems rather likely that it will become useful in the
future.
The code in BitstreamCursor::skipRecord and in BitstreamCursor::readRecord is almost identical. Maybe it makes sense to move that into a function that takes an optional Vals vector?