Tests for persistence

WIP