compile time check of store consistency

Need more work to generate helpfull error message, in the mean time
could use run time check instead
consistent persistent storage for all classes