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

Yeah the cast is needed, and it *really sucks* that we need the cast. Because Json::Value values don't support assignment from `std::size_t`. This needs to be fixed, as its a pain point.