add amd version

learn from https://github.com/umdjs/umd