Use DLIST macro whenever possible

This avoids crashes when manipulating the double-link lists by hand.
Merge pull request #128 from sixstone-qq/ejhernandez/idset-ranges-manipulation

Use DLIST macro whenever possible