With that much action going on in your fermentor there should have been a good CO2 buffer over the beer to keep the nasties out especially when you have foam pushing out. I had 3 blowouts on an airlock before I switched to a blowoff and had no problems.
Once the primary stage of fermentation...