So I take you are using an external keyboard now? Did you spill something on your keyboard? If not take it into an apple store if still under waranty and have it replaced. If not replace the whole keyboard. As far as a b.o smell, my mac mini had the same smell for two months and finally went away. I thought it was very odd.
Yes, the whole keyboard should be replaced. It's not really a do-it-yourself repair: to replace the keyboard, you have to take EVERY component out (including the logic board and display assembly).