Use d3.map in NewStylePlot. Also clean up some other code slightly [type-d3-map-set]

can we just make an issue to tracking doing this across the codebase?