add CommonJS / AMD support

puts a simple UMDish thing at the end of the module rather than always publishing to `window`