refactor general persist and restore of objects into DJCADpersist