So here's what I gather. Yamato is really a male. He ran into Ivankov and Jewelry Bonne years ago, and was subsequently change into a female, and turned into a child. While living as a female, he had to change his name to a girls name, so he just reversed the letters of his name, dropping the y, thus becoming O-tama. That explains his relationship with Ace, and already knowing and waiting for Luffy. J. Bonney must have recently been knocked out, undoing the child transformation, but Yamato still remains a female due to Ivankov.