The Genetics of Sex and Its Consequences