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

Will switch this back once I get the test contant things working correctly.