enable dynamic rerun of opencpu scripts. For each rscript run, we generate a guid. the guid and the tab id of the source page is stored at the output structure.

All the tunable parameters for each rscript are stored in a tunablevariables object. The data is bound to the gaggle_output.html.  When user change the parameters and click the run button, we find the output structure with the guid and build the parameters list. The list and the guid and tab id is passed to gaggle.js of the gaggle_output page, which passes it to the background page, which sends to the source page to rerun the script with the new data.

Once rerun is done, we pass the result to gaggle_output page, and the new data is bound to the existing output structure. AngularJS will automatically refresh the page.
We also remove the old gaggled data.