Updated code to use new createLayer API
Updated d3 code and test to the new create methods