Issue 6669: Refactor JSON parsing

https://code.google.com/p/fbug/issues/detail?id=6669