You have received lots of good advice already.
But just to add a few more thoughts...
My DD1 is a lot like you describe. She is nearly four and has been gradually improving over the last couple of months, but we do get a lot of the rejection, pushing us away, leave me alone type stuff, especially when she gets very upset. I always tell her that I'm right here if she needs me and to let me know when she's ready to calm down.
I don't leave her to tantrum on her own usually as it makes things worse. I just stay in the background, paying her no direct attention but still being there, if you see what I mean. If she tells me to leave her alone I just say OK, I'm here if you need me, and usually after a few minutes she comes over for a cuddle, we talk about what happened, apologise if necessary, etc.
I think it's important to remember that for many kids of this age, the huge feelings they are experiencing are overwhelming and they simply dont have the powers of rational thought to deal with them. So we really have to help them negotiate their way through their feelings, learn to control them but not deny or belittle them in any way. Easier said than done of course!
I found the book "The Science of Parenting" really useful in terms of understanding young childrn's brains. It helps when you realise there is a scientific reason for their behaviour, and they are not just being obtuse for the sake of it!
Ps just reread this and it sounds a bit patronising - not trying to be! Sorry.