converted apply to the requirejs style.  Added support for the requirejs in the jasmine tests.