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

I couldn't figure out any way to initialize `NameBuff` besides exposing this function. Please let me know if there is a better way