Add new dl_list functions and tests, and refactor.