export.js: Export in all CommonJS environments

Closes #521
The `define.amd` check looks questionable. There is no check anywhere that `define` is defined before `define.amd` is accessed.