My theory portion of it is that Uzumaki are a branch of the Senju, and that Kaguya(the clan) are the descendants of Hamura.
The puppets Sasori uses keep their chakra, at least part of it, and that is why he can use their abilities. I believe this was stated somewhere in the battle between him and Chiyo.