Add support for CommonJS and AMD.

I've tested the AMD support in my Backbone Boilerplate project, but have not tested the other setups. Code is based on amdjs's Backbone fork: https://github.com/amdjs/backbone/blob/master/backbone.js