simplify module.exports to allow passing d3 as arg

makes it so d3 doesn't have to be global