A reconstruction of sexual modes throughout animal evolution