support umd

adding umd support.

cc @ianstormtaylor