Replacing the battery while leaving the car on is dumb in the first place, a simple 9V battery in the ciggerete lighter keeps everything from resetting....
Anyways, Whats happening sounds like it has nothing to do with the battery/alternator. SInce you have issues when gassing it then letting it fall to idle, it sounds more like a airflow/fuel metering problem.... Like it is expecting more air when you close the throttle but it's not there so it dies... I would take it to a respectable tech.