Passing userdata instead of cid everywhere

This is a breaking change, and I think it's safe to assume that most NPC
scripts are broken and the NPC system needs a rewrite/some backwards
compatibility patch to pass id's instead of userdata to callbacks.