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

`make unittest` works locally with the current state of things.
The build is failing on Travis CI though. 

Creating special test constants seems to be more work than anticipated...