factor out commonjs dep extraction as a sep module