Move static treeNodeCache from SHAMap to the Application

These changes address two JIRA issues:

 - 291 unittest reported leaked objects
 - 292 SHAMap::treeNodeCache should be a dependency injection

Thanks for removing all these spurious refs - which are DEFINITELY not needed for make_shared!

(David pointed out on chat some cases where removing ref would add a copy - but all your ref removals are correct...)