Use a collections.deque which has thread safe pop/append

Incase of multithreading deques are inherently safe to do
pop/appends on while arrays may not be (but are likely). To
ensure this use the deque which is specified to be thread
safe for these operations.
Make name also use a deque
Merge pull request #1 from harlowja/master

Use a collections.deque which has thread safe pop/append