Refactor cdl to use lists-of-lines.  Add proper unit tests for cdl(group).