Add UMD wrapper that works with browser/amd (adapted from https://github.com/umdjs/umd/blob/master/amdWeb.js)