create, resize and move events are dispatched with a property representing position and current size of widget
also fixed module injection code so that script can be loaded as a module using  a library like requires