Move cycle-checking and type-tagging into the Schema.