feature(views): allows rendering empty results using an anonymous function

If you want the no_results message to not be wrapped by P tags, or you don’t
want to always incur the cost of rendering a view for backup content, you
can now provide a Closure whose output will be echoed by the view.
perf(likes): reduces number of queries when showing likes in lists

For each entity in a list, this preloads the total # of likes and whether
or not the current user likes it in as few queries as possible.

Fixes #6941
deprecate(libraries): undeprecate the elgg_register/load_library functions

This reverts commit 190b69216e889274621b3ca15b5055c605b1067c.
chore(libraries): update library loading functions to use config service
chore(services): add missing property declarations on service provider
Merge pull request #7564 from mrclay/missing_props

chore(services): add missing property declarations on service provider
Merge pull request #7563 from mrclay/undeprecate_libs

Undeprecate and update the elgg_load/register_library functions
perf(sql): allows removing DISTINCT from some MySQL queries

We add the "distinct" option to a few query functions to allow devs to
remove DISTINCT clauses from queries where they are unnecessary and worsen
performance. We also set the option in some core queries where it's unlikely
to cause trouble.

Fixes #4594
chore(metadata): Pull most services in MetadataTable into member variables

This also gets rid of the unecessary _elgg_get_metadata_cache() and makes sure
the metastring cache receives string keys.
chore(access): refactors lib/access and AccessCollections to use services

Also fixes the phpdoc on $CONFIG->site_id and makes it clear this is just a
copy of $CONFIG->site_guid.
Merge pull request #7349 from mrclay/no_results_closure

feature(views): allows rendering empty results using an anonymous function
deprecate(access): deprecates elgg_get_access_object() and refactors access lib

This moves the access object and access cache to be served from the service
provider, and refactors AccessCollections to remove the need for $CONFIG.
Merge pull request #7570 from mrclay/access_refactor2

chore(access): refactors lib/access and AccessCollections to use services
Merge pull request #7567 from mrclay/ewinslow-memcache-cleanup

Pull most metadataTable services into member variables
Merge pull request #7571 from mrclay/access_refactor

deprecate(access): deprecates elgg_get_access_object() and refactors access lib
Merge pull request #6990 from mrclay/faster_likes

perf(likes): reduces number of queries when showing likes in lists
perf(db): Disabled SQL DISTINCT in more cases.
Merge branch 'Srokap-pr/7338' into 1.x
chore(services): cleanup service provider and remove 5.2 support