Helper file for rendering to d3 and corresponding demo files, v2

Updated pull request with the suggested changes, trimming out unused css and d3 code.