commonjs and amd support, or expose to window as usual. fixes #77 fixes #108
jshint fixup