Parameterize buffer and support batch inserts.

The initial buffer may be too small for certain applications, so it has
been both grown and enabled for parameterization.

The API now supports batch inserts in a memory efficient manner.