Switch from singly-linked lists to doubly-linked lists. Implements #10.