[cubicweb/postgres] several refactorings of the cubicweb.postgres state [in-progress]