Optimize requirejs config better
- Moved the entire logic to the require.js config - TODO: Optimize further with promises