Removed require.js and refactored to do without it