SPDY: better encapsulation of header encoding/decoding