Why is the electric field created by a battery non-conservative? Electromotive force(emf) or $\mathcal{E}$ is defined as $$\mathcal{E} = \oint \frac{\vec{F}}{q} \cdot \mathrm{d}\vec{s}$$ Here, $\vec{F}$ is the force which pushes the charges through a conducting wire loop, $q$ is the magnitude of charge and $\vec{s}$ is the displacement of the charge. $\mathcal{E}$ is the tangential force per unit charge in the wire integrated over length, once around a complete circuit. 
Now in my Physics book, it is written that an emf must be nonelectrostatic in origin. Only then, it can force the charges to move in a loop. Conservative electric fields cannot make the charges move in loops. Now, if we connect a battery and a resistor with wires in a loop, a current is established. This means that a battery has some nonelectrostatic forces which can separate the positive and negative charges or otherwise $\mathcal{E}$ will become $0$ when integrated over the whole circuit. 
What is is this nonelectrostatic force which is responsible for driving the electrons? If its chemical, due to the electronegativity differences, how is it nonelectrostatic? Electronegativity occurs due the electrostatic attraction of the electrons and the nucleus plus some shielding, doesn't it?
 A: 
What is is this nonelectrostatic force which is responsible for driving the electrons? If its chemical, due to the electronegativity differences, how is it nonelectrostatic? Electronegativity occurs due the electrostatic attraction of the electrons and the nucleus plus some shielding, doesn't it?

This is actually a nice example of the fact that although chemistry is based on electrical forces, chemistry cannot be explained using classical electrostatics.
I think an example that's easier to understand but illustrates the same principle is a metal surface exposed to a vacuum. Work is required in order to remove an electron from the metal. This amount of work $W$ is known as the work function of the metal. Microscopically, various complicated phenomena need to be taken into account in order to calculate an accurate work function for a real metal.
However, a good example of such a phenomenon is the following. The electrons in the metal have a density that stretches farther out into the vacuum than the density of the protons. This is a quantum-mechanical effect arising from the Heisenberg uncertainty principle and the small mass of the electrons. It's analogous to the fact that in a single hydrogen atom, the electron's probability cloud gets much farther from the center of mass than the proton's does. At the surface of a metal, you can estimate the thickness of this skin using models such as the jellium model, and the expression you get has Planck's constant in it.
Because of the existence of this electron skin, the surface of the metal acts like a dipole layer. There is a difference in potential between the vacuum and the metal, which is the work function, and in this simplified model it's caused by the dipole layer.
The existence of this dipole layer cannot be explained by classical electrostatics. In fact, there is a theorem that says that an electrostatic charge distribution can never exhibit a nontrivial stable equilibrium.
A similar example is the existence of molecules with dipole moments. We make cartoons of these with charges stuck at the ends of a stick. But in reality there is no "stick force," only electrical forces. Classically, the electrical interactions cannot stably sustain the separation of the opposite charges.
As a simplified model of a battery, you can make parallel plates out of two dissimilar metals such as copper and zinc, with a vacuum between them. (This is similar to a voltaic cell, and in a voltaic cell the emf would be approximately equal to the difference between the work functions.) Let's say we just short them by connecting them with a wire, and we also keep them in thermal equilibrium. Because the work functions are unequal, there is an electric field in the vacuum. This electric field is created by a flow of electrons out of the metal with the smaller work function and into the metal with the larger work function. These electrons have flowed against the electric force. That would not be possible classically, just as the existence of molecular dipoles would not be possible classically.

What can we say about $\int \frac{\vec{F}}{q} \cdot \mathrm{d}\vec{s}$ inside the battery?

In practical laboratory terms, the force $F$ in this definition is usually described as some sort of sum consisting of terms that include the $qE$ due to the electric field, an effective chemical force, and an effective thermal force. So the short answer is that the $F$ inside the battery contains a term from an effective chemical force, and this force is not the same as the electrical force. In fact, it's in the opposite direction.
At a microscopic level, the origin of things like effective chemical forces are quantum mechanical degeneracy pressure. As a model of this, consider a particle in a box, with the walls of the potential well being finite on one side: 
$$
V(x) = \begin{cases}
    W, & x< 0 \\
    0, & 0<x<L,\\
    \infty, & x> L,
  \end{cases}
$$
This is a simplified model of the potential experienced by an electron in a metal that is open to vacuum on the left. (The infinite potential barrier on the right is just to make the toy model easy to work with.) As a trial solution to the time-independent Schrodinger equation for this potential, we could try
$$
\Psi(x) = \begin{cases}
    0, & x< 0 \\
    \sin kx, & 0<x<L,\\
    0, & x> L,
  \end{cases}
$$
where $k=L/\pi$. However, this is not a solution to the time-independent Schrodinger equation. If we initially put an electron in this state, it will evolve over time into the true ground state, which includes an exponential tail tunneling into the classically forbidden region $x<0$. This time evolution involves a net motion of the center of mass to the left. The force that causes the electron to do that is the degeneracy pressure, $d(h^2/8mL^2)/dx=-h^2/4mL^3$. The fact that there's an $h$ in there tells you that this is a quantum-mechanical effect. If you use more realistic models of degeneracy pressure instead of this toy model, you still get expressions that have $h^2/m$ in them. This electron degeneracy pressure has caused an electron skin to form, and the process of forming that skin increases the electrostatic potential energy. That is, we have a force that counteracts the electrical force until a new equilibrium is reached.
