Well Alex, i hope this will help you a little ;
-It was I who got a present last night.
Here "I" is subject. To understand it better, note that you will say "I got a present last night."
You won't say "Me got a present last night."
-"It was me they elected as the moderator!" Or "It was me whom they elected as the moderator".
To understand why it is so, remember that you will say "They elected "me" as the moderator."
You will not say "They elected I as the moderator."
Here "me" is "object" . ( unlike the previous example which "i" was "subject")
-It was I/she/he "who" danced in the club.
-It was me/her/him "whom" they saw dance in the club.
If you can't decide which is correct, try placing the pronoun (I vs Me, etc) in front of the action!
( BTW don't take any of the examples serious)