Address some cache corruption issues

This patch set improves cache validation behaviour in unit tests, and fixes some corruption issues identified by Bella. 
I've made the decision to make the steps cache less ODT-specific, as it allowed cleaner fixing of the identified problems.
There are negligible performance impacts by these changes.