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

__Done__ Switched to enums since the pre-processor stuff got messy