d3 move selection to front. note - this may mess with data bindings to be sure, use an explicit binding in the data function e.g. selection.data(data, function(d){ return d.index; } )
d3.selection.prototype.moveToFront = function() {
return this.each(function(){
this.parentNode.appendChild(this);
});
};