web-ui: split js code up into modules for better maintenance

web-ui: split js code up into modules for better maintenance, uses requirejs for parallel loading of dependencies