Added allocate(min, max) to opportunistically allocate extra memory, and
      modified capacity(newSize) to efficiently trim the size of a "normal"
      sized buffer.