Add store consistency checks to store migration tests

Small cleanups and refactors