Fixes: U4-5992 Caching of XPathNodeIterator in umbraco.library is not thread safe and will cause media errors like valueDictionary exception
working on U4-6030
working on U4-6030
Fixes:  U4-6030
Fixed: U4-6051 HasAccces method tests the roles of the wrong user
Fixed: U4-5193 HasAccess override method name error
Merge pull request #599 from solutionmania/dev-v6

Merge into dev v6
Merge remote-tracking branch 'origin/dev-v6' into dev-v7

Conflicts:
	src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
	src/Umbraco.Web/umbraco.presentation/library.cs
	src/umbraco.businesslogic/Application.cs
	src/umbraco.businesslogic/ApplicationRegistrar.cs
	src/umbraco.businesslogic/ApplicationTree.cs
	src/umbraco.businesslogic/ApplicationTreeRegistrar.cs