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

Is this cast actually needed?  If so, perhaps use static_cast...?