Reworked yui loader to reduce cyclomatic complexity.