Add persistance tests and refactor existing persistance tests