In Section 2.3.1 of Griffiths' text on electrodynamics he defines the scalar potential $V$ as $$V(\mathbf{r})=-\int_{\mathcal{O}}^{\mathbf{r}}\mathbf{E}\cdot d\mathbf{l}.$$
In Section 2.3.2 he states
The word ''potential'' is a hideous misnomer because it inevitably reminds you of potential energy. This is particularly insidious, because there is a connection between ''potential'' and ''potential energy'', as you will see in Sect. 2.4. I'm sorry that it is impossible to escape this word. The best I can do is to insist once and for all that ''potential'' and "potential energy" are completely different terms and should, by all rights, have different names.
In Section 2.4 he shows that the work required to move a test charge $Q$ from $\mathbf{a}$ to $\mathbf{b}$ in the presence of a collection of source charges is given by $$W=\int_{\mathbf{a}}^{\mathbf{b}}\mathbf{F}\cdot d\mathbf{l}=-Q\int_{\mathbf{a}}^{\mathbf{b}}\mathbf{E}\cdot d\mathbf{l}=Q[V(\mathbf{b})-V(\mathbf{a})].$$
And this implies that $$V(\mathbf{b})-V(\mathbf{a})=\frac{W}{Q},$$ so that the scalar potential difference between $\mathbf{a}$ and $\mathbf{b}$ is equal to the work per unit charge to carry a particle from $\mathbf{a}$ to $\mathbf{b}$. In particular, if we wish to bring $Q$ in from far away and stick it at the point $\mathbf{r}$, the work we must do is $$W=Q[V(\mathbf{r})-V(\infty)],$$ so if the reference point is infinity $$W=QV(\mathbf{r}).$$ He then states
In this sense, potential is potential energy (the work it takes to create a system) per unit charge (just as the field is the force per unit charge).
I find this very confusing. I thought that energy was the ability to do work, and that work is defined as the line integral $$W=\int_{\mathbf{a}}^{\mathbf{b}}\mathbf{F}\cdot d\mathbf{l}.$$ If these definitions are correct, then $V(\mathbf{r})=W/Q$ doesn't seem to have anything to do with energy.
If, on the other hand, energy is "the work it takes to create a system", then it is correct to say that the scalar potential is the potential energy per unit charge required to create the system. But if energy is "the work it takes to create a system", I don't see how this definition is related to "the ability to do work".
I apologize for the obtuse question. I am from a mathematical background, and am not familiar with energy and work beyond a very elementary level, and would really appreciate any help in understanding this.
I think my question can be phrased more concisely as: what is energy in the context of electrostatics, and how does it relate to work?