Updated d3 code and test to the new create methods