Rearrange to use caffeinatedpersistence and a few api changes as a result