base: requirejs improvements

* Several improvements for better requirejs compliance.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>