Kids!
Your daughter is not a demon. She is a perfectly normal, though extremely headstrong, little person. I add that because I think all parents wonder if they've given birth to demon spawn when kids behave this way. (LOL).
Bodily functions are fascinating to kids. They'll get over it.
The hardest part is this ~ the second you lose your temper, she wins. Instead of parenting, it becomes a battle between you for who is controlling who. Make sense? This battle will escalate over time, and one day she will be too big for you to do much about. You will lose.
I'd try a new approach. It's not about how she behaves (so much) but about what she needs to learn.
1) People don't like to be hit, kicked, etc and they won't play with you if you keep it up.
2) Living in a dirty home is unacceptable. You are responsible for the messes you make. Wanna poop in your bed? Ok, then you must do the laundry, wash the mattress, etc. (I'd also get a plastic sheet to cover the mattress, followed by a soft quilt top. It'll at least protect the mattress from permanent damage.)
I think she nailed it for you. She's bored. Bored kids are a terror. You'll need to find a way to capture her attention and interest. Something that she enjoys but is challenging for her. Can she join a local sports team? Take local classes like art, drama, gymnastics...something? The park districts usually offer very affordable classes.
My dad was very wise in this. He used to offer me challenges and rewards that I would have to grow into. He used to say things like, "It's too bad you didn't get all of your homework done. I was hoping you'd be responsible enough for a new puppy. Well, perhaps later." Then of course, I'd work like mad to get the new puppy! He NEVER offered anything he wasn't willing to give, and he was always casual about offering me new challenges. Obviously it doens't have to be a huge thing like a new puppy, but something that appeals to her and that she will work towards.
This is a tough one, too...but change your sentences.
I am very angry with you for
I do not like it when-
I love you best when- (lots of tickles and hugs go well with this)
Nice people don't-
Look how well you-
When scolding or pointing out unacceptable behavior, it's always about "people" or a simple statement about your disapproval. When pointing out something wonderful about her, it's always personal and direct, using "you" and her name.
I know it sounds stupid, but it does help. You don't want her to have a self-image where she's the bad one. If you believe her to be good, then she will believe this about herself.
Sometimes, parents can only shrug and say ok. Of course, this has to be followed by making the child bear the consequences. If she insists on hitting other children, then she can no longer play with them. Period.
The 4 year old has figured out that they can make choices without you. They are completely self-centered and do not realize that other people feel as deeply as they do. That takes years to figure out.
And your daughter is right...she can make choices without you. This is exactly what you want her to do, eventually. This is her practice time - to see what happens when she makes good choices and what happens when she makes bad choices.
Withdrawing from the girl will step up her behavior. You will need to be fully engaged and in control of you at all times. This is why parenting is so exhausting! It will take a variety of ideas and actions to work through this stage. And it probably is just a stage. It will take time for her to respond and work through whatever it is she's learning. Don't expect immediate results. We are all a bit slow when it comes to growing.
Personally, I have no problem with spanking a child on the rear, so long as the boundaries are very clear to the child. Others will disagree, but I think that's a decision each parent has to make.
Not sure if this will help or not. You are her mother. You know her best. Don't feel bad about being stern with her. She needs it, and she expects it from you. Fair, loving, stern when necessary, and fun...always have fun time with her every day, even for 15 minutes.
Finally, if she has a bad temper, use physical exercise to get it out. My son used to rage when he was about her age. I would jog with him and challenge him until he started laughing... Betcha can't pick up that acorn without stopping! Betcha can't outrun the dog! Or whatever....It worked really well. Still today, he immediately looks for physical exercise when he gets mad.
Best of luck.

We are what we repeatedly do. Excellence, then, is not an act but a habit.
Aristotle