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

fixes #4672