The old revision has a serious memory usage issue. For example, on Windows a 650 KB JSON file results in memory usage of roughly 2 GB of allocated RAM that won't be freed anymore. The updated version doesn't have this problem anymore. Fixes #1631.