Browser packing algorithm for duo. Based off of Browserify's browser-pack