add uint16 spec to buffer

related to 08ac823
change framer to use flag masks

The spec as written describes the flag masks more clearly than it does their position, not least because of the off-by-one issue in the textual description of the position.
update framing spec

Mostly fixing up frame headers (now with an extra byte of length), flags, and lengths.