upgrade d3 to v3 and fix some broken test cases
upgrade d3 from v2 to v3