Use __index to lazy register entity usages when community code calls mw.wikibase.entity.
We should only track an all usage for an entity table loaded via [[ https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.getEntity | `mw.wikibase.getEntity` ]], if the data on it is actually used. This can (later on?) be expanded, along with T151717, to track the most specific usages only.
Steps to get this enabled in production:
[x] Merge {T178153}
[x] Deploy T178153 (27cb7f6e1615db26460d035bc8ee372f1ec15f8e) AND MAKE SURE IT IS NOT GOING TO BE REVERTED (it should be in `wmf.n` and `wmf.(n-1)` before continuing)
[x] Change the `disabledUsageAspects` setting: `'disabledUsageAspects' => [ 'D' => 'O', 'C' => 'O' ]` (disabled description+statement usages) / `'disabledUsageAspects' => [ 'D' => 'O' ]` (disabled description usages).
[x] Enable this change (fine grained Lua tracking) in the settings for all statement usage test wikis. **This step needs to be done before the next:** Otherwise some/ most of the statement usages from the test wikis will disappear again.
[] Use compact representation of diffs in EntityChange. (T113468)
[] Make `AffectedPagesFinder` take description usage into account (T176417)
[] Make `AffectedPagesFinder` take statement usage into account (T176413)
[] https://gerrit.wikimedia.org/r/#/c/371651 got reverted and must be re-submitted (T179923)
[] Deploy this change
[] Gradually enable this on all wikis
Note: This is similar to {T76156}.