replace nb decoder with a proper escape parser

(fix #20)