fix parser and generated code, byte counter is plain byte counter. implement open, query_ext and encoding negotiation.