Mocked out filesystem in tests and added tests