I wrote this for my .JSON module:

Here is the gist page, if it doesn't show up here.

It seems to work pretty well and it's pretty simple, as long as it receives valid JSON.