[libcommhistory] Cache resolved contacts within a query

The models tend to resolve numerous events for a small set of contacts
within the scope of an executed query.