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

I usually do these things in a separate commit, in the same PR (a "prerequisite" commit, if you will).