Pass factory to define()

This fixes the AMD export which is currently passing an object (instead of a factory to `define()`).