Change getAllPurchases() to return a list of purchase data in json

This is an api break for getPurchases().

This is a somewhat brute force implementation of passing purchase data to Javascript. It just takes the json responses stored in Purchases, creates a list of JSONObjects from the responses, and calls the success callback with the list.

I have not checked how this works with new purchases done after the plugin has been initialized, but I assume it should not be a problem.