Implemented requirejs (messy, not everything works yet)