My car shakes and shuts off (or tries to) if I break too fast or too hard?

I have a 2005 ford focus wagon, and it just started happening about a month ago. If I break too fast or too hard the car starts to shake and I can see the lights on my dash flickering and sometimes the car shuts off completely (not the battery just the engine.) Even if you hit the breaks hard and let off the car keeps shaking for a few seconds after you let off of the break. I have replaced the rotors and the break pads and its still doing it. There's NO check engine light on, so what could it be? The calipers maybe? I would just rather fix it myself before bringing it somewhere.

Most likely is that the battery restraints have become loose or one of the battery cables is loose. When you brake the battery moves or one of the battery wires becomes disconnected from the battery for a short time and stalls the car. Check this first and let us know thru comments what you find.