Implemented proper error handling.

When parsing fails for a record, print the record number and error message.
The record number helps finding the offending entry in the messy JSON data.

Using Debug.trace for production is a bad, bad idea (it's impure!).