Improve buffer library to actually use a buffer.

Before the buffer library just used realloc repeatedly when a string was
appended. This patch makes the buffer library actually maintain a buffer.
Additionally, developers can pass a buffer (on the stack) to use, limit the
maximum size of the buffer, and have the buffer library call fatal on error.
Make buffer_t struct externally visible.

This makes buffer_t allocatable on the stack. This is yet another optimization
to prevent heap allocations for the general case.
Fix bug where buffer was not initialized with empty string.
Pull parameters of buffer_init into separate functions.
Add rewind functionality to buffer.
Fix test errors.
Merge branch 'batrick-buffer-improvements'

Before the buffer library just used realloc repeatedly when a string was
appended. This patch makes the buffer library actually maintain a buffer.
Additionally, developers can pass a buffer (on the stack) to use, limit the
maximum size of the buffer, and have the buffer library call fatal on error.