perf(entities): adds preload_containers option to elgg_get_entities

This allows devs to preload the containing entities of a fetched list. It
refactors the EntityPreloader a bit to support both use cases, and adds
container preloading to lists of group discussions.

Fixes #7663 

Where discussions appear across different groups, this save ~ 10 queries.
FYI diff is big because of flattening the function. The important section to review is [here](https://github.com/mrclay/Elgg-leaf/blob/preload_cont/engine/classes/Elgg/Database/EntityTable.php#L521).