Use deques for frame queues.

Python lists make bad queues. Rather than being linked-lists they're
actually fancy arrays. This means popping from the left (which frame
queues do) requires that the array be resized and potentially
reallocated. We should avoid some of that memory churn.