chore(gc): moved entities and metastrings gc functions to plugin

fixes #4672
Merge pull request #7421 from jdalsem/gc-system

chore(gc): moved entities and metastrings gc functions to plugin