fix for #493
fix for #495
Support for CommonJS (browserify/node) modules

Fixes #499, but could affect others. Changes the factory function to add a case
for CommonJS, and fixes package.json to point to the proper JS file.
Merge pull request #501 from suy/commonjs

Support for CommonJS (browserify/node) modules
State dependencies on package.json as well
Merge pull request #503 from suy/commonjs

State moment dependency on package.json as well
version bump to 3.1.2