Engine cache changes

high level goals of this PR are:
- less anonymous / inner classes
- evicted directories metric
- more composable objects / less static logic
- slightly better test
- formatting corrections