Hard error on JSON truncation

JSON files are currently truncated if they're too long, and the user is given a syntax error. Due to some quirks in the JSON parser, there can also be trailing data that is silently truncated. This patch makes the truncation explicit.