[WIP/RFC] Add unit tests for buffer.c and fileio.c

> I would also be willing to throw this whole section out and just make the constants in buffer.h into enums as I think that would make everything happy and working.

If that works, I think it would be the ideal solution (in terms of code size, clarity and thus happiness).