added check for module as well as require for node environment

When using requireJS in the browser, it attempts to load modules defined
by require(). Not sure if these can be configured to load in browser too
but quick fix is just to add extra check to ensure node environment.