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

Made this change. The comment suggesting it was on a commit that got clobbered so I don't remember who requested it.