Complete work on the filesystem

- Wrote a whole bunch of tests around the functionality and split them
into their own file.