LuaGuiElement provides .tags, which is a Tags object: https://lua-api.factorio.com/latest/concepts.html#Tags
Will need to be careful to directly update .tags and not mutate, but it should work fine otherwise. Unable to store functions in this object, but that is good since we should be rebuilding event listeners and such when we load the save file.