[NEXUS-5554] Reorganize NX namespace, allow plugins to specify require.js module/dependencies directly

Use requirejs for most of what was in lib and move to a different namespace.
Introduce support for plugins to specify their js dependencies directly.