The issue is that the adoption of the term "gender" to mean an identity as a distinction from "sex" to mean a physical characteristic is very much new - the terms are pretty much interchangeable, although "gender" means "sort, or kind" and "sex" means "division in two". However, although "sex" as a verb means "to get jiggy with it", neither term has ever meant what kind of thing you're attracted to - sexual orientation doesn't belong in the discussion except as a way to baffle religiousists ("hey, is a dude who sleeps with a dude who used to be a chick still gay according to Leviticus? What about a dude who sleeps with a chick who used to be a dude? What if he sleeps with a chick who secretly wants to be a dude, or a dude who openly wants to be a chick?", and so on).
In essence you should keep four terms in mind:
* Trans - across, or opposed
* Cis - alongside, or the same; not a wholly necessary term, but one frequently used
* Gender - psychological sexual identity
* Sex - physiological sexual characteristics
There's a light muddying of the waters with biology here, because really you have two sets of physiological sexual characteristics - chromosomal (genotype) and physical (phenotype) - and they may not be the same thing. Someone with a male genotype may present as female, or indeterminate. And then there's external and internal physiology, where individuals with a male genotype may present externally as female but internally as male (such as in AIS). There's definitely an episode of House based on that one.
Thus you can see that someone who is "trans", "gender" is someone whose psychological sexual identity is opposed to their physiological sexual characteristics. There's a disorder name for it of "gender dysphoria" (gender is psychological sexual identity, and 'dysphoria' literally means 'bad body'). The surgical treatment is "sex reassignment surgery" because it reassigns your (external, physical) physiological characteristics - your sex - albeit in a non-functional manner. Still, there's plenty of people born with those bits that have non-functional ones.
There's a whole suite of types of transgender precisely because there's only really two types of sex - anything other than cis-male and cis-female (again, terms that aren't wholly necessary, but which mean "physiologically and psychologically male" and "physiologically and psychologically male", thus shorter to type) is by definition transgender. Maybe cis-neuter too - agender and... freak smelting accident.
Obviously there's the traditional ones you hear a lot, with simple opposition: male to female, female to male. Agender is someone who has no gender identity - they do not regard themselves as a gendered being, regardless of physical sexual characteristics. Genderfluid would be someone whose gender identity is not fixed. Genderqueer, perhaps a slightly less popular term for non-binary (because of the implications of 'queer' on sexual orientation, even though it's not really part of the discussion; queer in this context is a verb meaning 'to twist or question'), means someone whose gender identity is not described in terms of maleness and femaleness as they reject that such a distinction exists*.
Sexual orientation isn't part of the discussion simply because who you are doesn't have any effect on who - if anyone - you want to screw. You might be MTF and go for women, or for men, or for neither. You might be agender and still love a big old pair of titties. You could be monogamous, polyamorous, or just not get involved. You might have... a paraphilia. It's exactly the same as if you're a guy born a guy, or a girl born a girl, so it's not really relevant.