(bug 32537) Pre-register default-loaded RL modules in the client-side
loader.
Site, user, and user.groups modules are pre-registered in JS client-side
loader. This prevents loading them again if they're given as explicit
dependencies of some other module.
Enabled modules are registered as "loading", disabled ones as "missing".
Empty modules register themselves as "ready".
Also adapt the client-side mw.loader.state to ensure that dependencies
are tracked if called with state "ready".
Note the FIXME in OutputPage.php; methinks this is an already existing
issue not fixed by this change.
Changeset 2: fix bug number in commit message (32537, not 32357!)
Changeset 3: change 'ready' registration as discussed; adapt line
lengths; clean up client-side code.
Changeset 4: "missing" status for disabled modules.
Change-Id: I595b3af1900d4bec0c35940ef51a19c8a7440faa