Added cache access history and trimming functionality. For #37