Alternate implementation for addJSONData.

Now has a companion, getJSONData and it no longer adds stuff to the window object.