Split test framework code into common_test.go.

Add mockCache testing to ensure coherence with the real implementation.