Not all of these changes were correct. Will reland appropriate parts in a follow up. This reverts commit 4a792965.