Add optimization to avoid large crawls of the reference tree.

The UI needs certain information from the ClassInstance that's causing
a full crawl+copy of the reference tree. This added functionality will
simply return the total count without performing the full allocations
and copies.

Change-Id: I0ab18cce7ed70ea0142e23e1556472ea2e077570
2 files changed