I'm fairly anal about keeping my gi clean. Shout! stain remover, White Brite, and white vineagar are my laundering tools and they have served me well.
Shout! is a great stain remover to use around the collar or other problem areas each time prior to washing.
White Brite is great for removing yellowing and brightening up dingy whites. Give a good long soak - even overnight - if your gi is in really bad condition.
White vinegar does charms as a rinse cycle additive. Helps keep the gi soft, white, and odor free.