base: requirejs improvements

Just made it requirejs compatible and checked that it works.

Maybe it is not needed but in any case there @kneczaj reimplementing the JS for the facets.