Break FileResourceDatabase into separate file, and add unit tests using gocheck.