Adds a queue container

Adds a queue/FIFO container, considering the feedback given in #2361.
Probably better to just have `dequeue` return the container, and get rid of this method. It's not necessary to have two different methods for this, since the caller can just ignore the return value if it's not needed.