move some classes from dataflow module to diagram module to make them reusable