Added snapshot field so that we only initiate compact when we need to
Separate threshold and cache entry into new files