Add commonjs module support

This commit adds commonjs module support by adding an 'else if' clause
to each of the if statements that determine if we are loading amd
modules, or if we're directly in the browser. Adding commonjs module
support allows use from within browserify.