resourceloader: Return a promise from mw.loader.using()

This implements support for:

    mw.loader.using( 'foo' ).done( callback );

Cleanup:
- Validate array input using $.isArray
- Simplify code

Change-Id: I9e145cfde24f582b123707ed20cb0fca60fccb2c