Simple JavaScript FIFO queue implementation to avoid having to do shift()