Fix bug: Whole cache is not written into file at the and of program.

Not fully filed cache must be written in to file after the programs ends. So deinit at DataChunStorage now check if all data from cache has been written or not. For purpose of storing only part of the cache function writeCache has new parameter which determine how much of the cache entries must be written.

At the same time indexes in to cache was renamed because the previous name was not exactly what the variable meant. Previous name referred to writing into file but in context these variables meant only storing in cache memory.