Add CDCM grouphhcap and tidy up some graph-related code.
EDCM improvements (particularly DCP 189) and tidy-up.