(undergraduate) my graduate student is extremely cutthroat
In reading over your description, a few things stick out to me as very problematic. My concern is not the past issues - but how you'll be able to handle future issues with people like this, because you will encounter people like this no matter where you go.

The first issue is that you do not seem to have a healthy line of communication with your PI. If the PI said, "hey, that's a good idea, write that up as a grant and talk with X for help", and X shot you down and suggested something that sounded unethical...things should not have stopped there!  Directly after you should bring it to the PI, with "I did what you asked/suggested and something odd happened. Do you have a moment to talk about it?" The goal is not "telling on" someone - it's clarifying with someone who is responsible for the work done in their group and has more experience than you. Perhaps you misunderstood the grant process, or perhaps they were trying to con you into getting them a grant in a way that was fraudulent. In either case, it's the PI's role to help you, by explaining the grant system or by revising their instructions to you (and now being aware that their grad student is acting 'funny').

The second issue is your description of that odd conversation you had about being supposedly "stressed"? That sounds like a textbook description of a method called "gaslighting", and yes - it's supposed to make you feel crazy. The point is you are supposed to go "wait, why would they say I'm stressed, I'm not stressed - am I? I didn't think I was stressed..." and then you get stressed, and  you start to doubt your own experience of reality. And you are supposed to start getting defensive and searching your memory for any time you screwed up to try to justify their behavior, and start talking about that one time even though no one asked about it to defend yourself, etc. See what happened there? You'll start to look and feel crazy, because no one sees the crazy nonsense you were attacked with. It's a tool of emotional abuse and manipulation. They are also seeking to do it by proxy and poisoning of the perceptions of others, which is a sign of further aggressiveness. 

Add the ethically questionable 'flexibility' which appeared to have a self-serving bent to the use of multiple tools of aggression and manipulation, and you've got yourself a lot of red flags - enough to make me suspect you are dealing with someone with malignant personality tendencies. These people aren't fun to deal with and prolonged exposure is a danger to one's welfare and goals. Take this possibility seriously, and begin taking steps immediately to protect yourself.

The third concerning issue is authorship. This can feel like a difficult subject to discuss, but again this requires you talk with your PI. The relationship with this person is far, far more important than any jag-off grad student - your dealings with them is fundamentally important, as it is with any direct supervisor relationship. Authorship is not a reward for abstract merit or seniority - it's a question of "who directly and significantly contributed to this research effort", and you should not ever be a position of having worked on something for even weeks yet not getting proper acknowledgement - let alone years! Again, this is largely controlled by your PI and you must talk with them about it, not simply allow yourself to dwell in the feeling that maybe you are going to get screwed.

Overall, full and effective communication with your supervisor/mentor/PI is crucial here. If you have it, people like this get put down early and they are like cockroaches - once the light is on, they scatter, because you aren't in a position they can easily take advantage of. If you can't have that relationship with your PI, honestly the research they do doesn't matter. No matter what it looks like on paper, if the PI won't have a good opinion of you because your relationship is poor (due to a lack of communication and the resulting sabotage that becomes so easy for people to pull off), it's better that you spend your time elsewhere so you can have a good relationship and a good, solid reference.

So your task will be to talk with your PI and figure out what the issue is. If you can have a good relationship, authorship is dealt with fairly, you can bring future concerns of an important nature to him straight away, then so be it. You'll need to be careful of your issues with the grad student - don't think they'll just act like a reasonable person all of a sudden. 

Once those issues are ironed out, then you can also decide whether or not you want to try out a different lab using your new found knowledge of how to handle things. When you've grown skilled in communication and relationship management with people like your PI, life goes much easier - and you'll find that people like the grad student you encountered seem to just be able to "smell" that their tricks won't work, and more often than not they just focus their attentions on easier prey. But without that core relationship building and communication, you'll be taken advantage of by every unethical and manipulative nutter you come across, and they'll swarm to you like a bunch of blood-thirsty mosquitoes.