Make json parser slightly less terribad.
Cleanup json parser.