keep Dag type abstract

The type definition of dags is put into a separate internal module to
keep the type abstract.