[loader] Add support for optional dependencies

Optional dependencies are modules that are not in the `requires` list because they depend on a test passing. Contrary to the current `condition` option, the test is owned by the optional module itself, not by the required module.

Example:
```js
YUI({
    modules: {
        foo: {
            path: 'foo-min.js',
            test: function () {
                return true;
            }
        },
        bar: {
            path: 'bar-min.js',
            optionalRequires: ['foo']
        }
    }
}).use('bar', function (Y) {
  // ...
});
```

This is WIP. I'm still figuring out what all the edge cases are and this need changes to Shifter to fully integrate it into YUI.