A better check for Node.JS which takes into account the fact that some browser deployments may use CommonJS rather than AMD.
Merge pull request #52 from hiddentao/nodejs

Better test to see if we're running in Node.JS without breaking CommonJS browser apps.