Don't dump redundant dependencies in cast objects yaml
Don't dump the referenced table in ForeignKey yaml

Notice that there is a dependency on the index used. This is real: if we
define the table and not its pkey (or the unique index used by the fkey)
reconstruction fails.