Implements a dumping and restoring strategy to speed up tests.