browserify/stitch support (cherrypicked from nixmrak/jsmarkus)