AMD compatibility

If exports is not defined, the AMD compatibility breaks.

Ideally, everything would be wrapped in a scoped function for the `exports`, but this simple fix will at least make it work without changing the overall code structure. The leaking `export` global for AMD is certainly not ideal, but I don't see it causing any real world problems.