fixing AMD export

the function passed into `define()` is executed by RequireJS, so you need to wrap the function you return in an initializer…