Sort actors and groups for better diffing