Wrote the filesystem functions. They are likely to be replaced at some point in
the future by something more sophisticated, but now they should be testable.
Wrote unit test to accompany the filesystem code.
Fixed filesystem code in accordance with what bugs came up.