An implementation of Kaplan's and Tarjan's persistent deque.