Update d3 definition

Moved interfaces into a module and renamed interfaces.
Added new typing's and comments.