graph: rewrite class manipulation with d3js *.classed