Change buffer.h #defines to enums so they can be used in tests
Add tests for buffer.c and fileio.c