Create separate JS files for widget

* Move call to `addCSSRules` outside of loop.
* Call `addBack` instead of `andBack`.

@alex-deaconu @stulees Please review. Thx.