Add jQuery require to CommonJS module definition

Currently the CommonJS (node, browserify) side of the module definition doesn't work due to the fact that it doesn't pass jQuery in to the factory function. This PR rectifies that, and accounts for the two most common cases:
- where jQuery is already included on the page
- where the npm 'jquery' package is bundled by browserify