Changed underlying data structure for buffer to simple queue.  Fixed
error where more than the specified number of items would get flushed at
any particular time.