Why does electric field remain confined to a wire? When I connect a battery across the two ends of a copper wire, the electric field set up in the wire will follow the direction of the wire, no matter how weirdly the wire is bent. How does this happen? Why does the electric field not shoot out from any point on the wire?
I am thinking that something similar happens to magnetic field, and it gets concentrated through materials like iron in the core of a transformer. I don't know the reason for that either.
Assuming that the wire has a uniform resistance per unit length, please answer this question, with reference to distributed element models (and not lumped element models).

Note: I know that one should not connect terminals of a battery with a copper wire directly, it can cause the battery to burn. The visual is only a creative representation of my question.
 A: That's a very good question. The process of starting a current in a wire is actually quite complex. Quite a lot happens before the circuit is complete: as you move the wire towards the  first battery terminal it encounters the dipole-like electric field between the two terminals. Charges flow in the wire to maintain it at an equipotential, and this results in a distribution of charge around the outside surface of the wire, cancelling within the wire the $\mathbf{E}$ from the battery. The end result of this process is that the dipole-like field exists between the other terminal and the far end of the wire. (Of course we are assumuing that it is always possible for an electrostatic charge configuration to make the wire an equipotential, regardless of the complexity of the path it follows. I don't know of anyone who has addressed that question, although the fact that current will continue to flow as long as there is field within the conductor makes it plausible. But can that be made into a sceptic-proof argument?)
Then as the wire approaches then second terminal the same process continues, maintaining the wire as an equipotential. Finally, when contact is made, a voltage step travels at the speed of light round the circuit initiating the current flow. The voltage step weakens as it travels in proportion to the resistance it encounters, and there is probably some transient oscillatory behaviour before the DC situation is established.
I don't know of a detailed integrated account of this process backed by calculation or modelling, elementary though it is. It's just assumed. The problem is that it depends in detail on the specific geometry, and that makes analytic calculation possible only for unrealistic simplified models.
