Move implementation to fs.c.

Libraries usually have the implementation defined in an accompanying .c
file, that gets compiled to an object(.o) file.

Move implementation to .c and remove includes from header.
Include required headers in test.
Notify compiler we're using POSIX extensions(truncate, ftruncate, etc)
to remove compiler warnings.