model: Add cache for file/lines, and test that in the unit test