Move script to core.js, since apparently gadgets work in a separate space than the rest of the javascript, which was causing resource errors