Remove use of std container.
Some std::deque implementations can't be declared with an incomplete type, so just use a manual linked list instead.