Added support for AMD, CommonJS strict (fixes #116, #136)

Based on [UMD example](https://github.com/umdjs/umd/blob/master/commonjsStrictGlobal.js).

I've also added better CommonJS support. The old version did not support strict implementations (which should use the `exports` object directly instead of the `module` object). Sadly this means I had to extract the local `rivets` object into a `factory` function, but this should not affect any other code.