encoder.js :: implement encodeTupleHeader() and tests