Version4 trim to size tweaks

Minor tweaks to trimToSize.

Call method from OntologyManager when loading ontologies, if the ontology implementation supports it.

Trim the map for map pointers.