move platform.js out of widget to allow use of polyfills