Make set_payload more generic
Since we just do a memcpy anyway, it doesn't matter what type of pointer we get.  As long as the length is correct, this should work fine.