Wrapped the whole function with UMD

For use with Browserify/require.js