Added smart requirejs setup.

* Works for both release and build now.