rework module logic for use with Browserify