Added AMD support

Added AMD support in a manner consistent with @desandro's other projects (like draggabilly). Fixes #20.