refactor: extract anonymous functions, add comments, style changes
feat: options.moduleSystem to support RequireJS and Browserify exports