I'd say that loose connection at the starter is likely the cause of the problem. It's where power for the ignition switch comes from and if you lose power there, it will cut off the ignition. That could also cause a backfire condition because when the coil loses power it fires the high voltage wire to the distributor. I think if you clean up and secure that connection it should fix the problem.