Updated requirejs compatibility

Here's a clean version of the update.
I need a bit more time to figure out why the Travis build are not passing before creating a better PR