(bug 57646) Exclude missing entities from JS vars

Referenced items that have been deleted should not be
present in the wbUsedEntities JS variable used by EntityView.

Change-Id: I77af42488b4258ab9eb42682ac10123dd4a1d9ff
Merge "(bug 57646) Exclude missing entities from JS vars"