Make d3 data functions use promises instead of callbacks