Use $.toJSON instead of JSON.parse for compatability and

consistency with other parts that a commonly used by all browsers.
Restores compatability with IE 7 which is still responsible for 1.8% of
the page views at Wikimedia.

So this can be seen as a fix to a regression introduced with
I5f35a701843baa19

Change-Id: I3920e14d860c8dd5c67ed53e4b82d452118d12d8