Implement sqlite persistence helper with tests