clone() changes and fix for emitter.
Add patch() to generated wrappers.
Merge pull request #136 from alxhub/nested-entities-fix

Fix clone() of wrapped entities to not create longer wrapped chains.