Updated path to require.js

Path was `requirejs.js`, but is actually `require.js` in component directory.
Ensure callback is not undefined before trying to access properties
Checking that callback is of type function and that `type` is set before being used in error message
Merge pull request #35 from alex-seville/master

Rearrange undefined callback check in On