Full JSON stream parser
cleanup code for json import