Rollback of #1076366. This is not quite ready to go yet, because it depends on another issue (#1120290).