Dry up code for CSS transforms

Avoid some logic duplications by adding `iD.util.setTransform` and using it for setting CSS transforms on various elements.