Adjust contract-out so it uses the provide transformer machinery properly

closes PR 13946

This is probably not the optimal way to make this change; better would
have been to refactor the existing provide/contract implementation so
it does not glom the provides all together in the first place (instead
of pulling them out afterwards). Do it this way anyways, because I
have a big pile of contract-system changes in another branch that also
changes around how provide/contract works: this way will be much
easier to rebase those changes off of.