[core] Add tests for `throwFail` branch

This commit adds tests for the value of `this` inside modules when using
`throwFail = true`. This is because throwFail is actually branching the
attachment of the module. See
https://github.com/yui/yui3/blob/dev-master/src/yui/js/yui.js#L801-L810

Also adding missing test for legacy modules.