Adding some unit tests with FakeFS, and fixes

Seems like I found the problem with my environment and OOM (check my comment on #14). I also found a bug with the call to Logger.warn.

I added a simple unit test for FileResource using FakeFS, feel free to cherry-pick the commits you think are worthwhile.