Building a testable d3 charting application within Angular.js