move <script> from wml files to separate js files

Right now we have