Splitting off persistence.api.ts.
Double-running: old persistence stuff kicks off the new one too.