[Util] Moved entity-related functions to xpc/util.h.