Add UMD support

Added AMD support with a fallback to browser globals. ([UMD](https://github.com/umdjs/umd)).