Patch from #6, with changes to EntityProcessorBase removed for now, to make rebasing on 8.x-3.x easier.
Closes #3063055