You can replace the keyboard without doing the whole upper case however the original keyboard is riveted on making it fairly difficult. You need to rip the old keyboard out and take as many of the rivets with it as you can, then you can add screws where the rivets have been pulled out to fasten the new keyboard. If enough rivets don't come out with the old keyboard to properly secure the new one you will to manually remove more of the rivets so you can fit more screws.
Before you do the keyboard and trackpad you should check for corrosion on the logic board from the water as the issue may be due to damage on the board in addition to, or rather then either of the components.