Update d3 definitions

This branch updates `d3.d.ts` to its latest version, and fixed all the associated bugs from the new version.

No QE needed, because internal dev stuff.