First commit on the work for #693821.
Remove embedded code copies from upstream
merge patched into master