export.js: Export in all CommonJS environments

Closes #521
This line is too long (looking at the line limit in the style guide), but its also unreadable.