Deque

Implements a Deque, based on work by @petkaantonov.