Move API docs to buffer.h, implementation to buffer.c.