Handle invalid JSON.

I believe that even though example code is supposed to be elegant, it
should not contain omissions that could crash the Node process. It is
very likely that someone will try to run this code in a live
environment.

Feel free to disagree. :)