switched to requirejs and using r.js for js build optimisation, many other improvements