JSON stream parser and writer