I would think it would be a moving violation "traveling too close"... In any situation where you are unable to stop in time to avoid something the person in front of you does you are guilty of following too closely. Changing lanes to avoid hitting the guy in front of you is proof you were traveling too close, even if the guy in front of you was doing something stupid. So changing lanes to avoid him and the resulting accident all stems from the original inability to stop fast enough to avoid the guy who stopped in front of you. I know it all sounds senseless but it is the standard by how these type accidents are decided as to who is responsible and liable for all damage.
I'll cross my fingers for you but be prepared it might get worse. When I was a teenager I was in an accident where I was northbound and turned left into the path of a southbound car. The southbound car was speeding through a school zone but....the area wasn't "officially" designated as a school zone at the time so she wasn't charged with the speeding. She was driving a huge old Lincoln (the heavy steel ones) and I was in a newer compact ford. My car's front passenger side was completely destroyed, I took the windshield out with my head. She was uninjured and her car had no damage except a broken headlight and bezel. She later sued me and won because she said she developed a pain in her neck after the accident and her doctor gave her pain meds to which she became addicted and had to go to rehab. All this was supposedly my fault despite the fact she was speeding through a school zone but since she beat that on a technicality, her 55 mph in what was supposed to be a 25 it fell on me. Totally unfair but she won the lawsuit for $40k+. Turns out later it was complete BS and she faked the whole pain med addiction thing because her husband had just left her penniless and a lawyer friend turned the accident into a money maker for her.
Just saying, it might get bad so consider lawyering up.