extracted dag stuff to dagr module

Change-Id: Ie255ea20f1854ea710980f71ea504c4d5fe531fb