Fixes: U4-4215 Tree.config registeres tree inconsistently
completes: U4-4103 Publicize PluginManager for devs to use to create their own plugins
Cleans up some more of the old 'object' User Id references.
completes: U4-3282 Expose permission assignment methods at the service layer
Ensures we perform null checks in both GetAll and GetByQuery as we never want to include a null item in the resultant collection - which could happen depending on what the sub class repository is doing.

Fixes: U4-3145 Cache file periodically becomes corrupted: "Oops: this document is published but is not in the cache (internal error)"
Merge remote-tracking branch 'origin/6.2.0' into 7.1.0

Conflicts:
	src/Umbraco.Core/Models/Membership/EntityPermission.cs
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/PermissionRepository.cs
	src/Umbraco.Core/PluginManager.cs
	src/Umbraco.Web.UI/config/trees.config
	src/Umbraco.Web/Search/ExamineEvents.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs
updates more plugin manager defs
Merge remote-tracking branch 'origin/6.2.0' into 7.1.0

Conflicts:
	src/Umbraco.Core/PluginManager.cs