Major revision.

Queue now works on different sized arrays, works on sizes not a power of
two, doesn't overwrite old data if the queue is full.