export.js: Export in all CommonJS environments

Closes #521
Is there a reason against using [grunt.util.spawn](http://gruntjs.com/api/grunt.util#grunt.util.spawn)? That should simplify this code quite a bit.