Modified index.js to allow it to be required by Node or RequireJS in the browser.

A special module had to be used in order to accomplish this (called amdefine).