Add tests for structured header encoding/decoding