Energy of the system is the quantity that is conserved as a result of invariance with respect to translations in time, i.e. the laws that govern your system are the same irrespective of the time (the actual behaviour may depend on time, given suitable initial conditions). I like this definition since it focuses on what is important, not some magic formula, but the general (usually desired) property of the system.
What follows relies on Lagrangian mechanics. In case you are lost, I suggest looking into Goldstein's "Classical Mechanics"
Kinetic energy is the type of energy that a 'free' particle would have. So let's look at the Lagrangian for a free (non-relativistic) particle with mass $m$: $L=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$, where $\mathbf{r}$ is the position of the particle, and $t$ is time.
For a general Lagrangian $L=L\left(t,\,\mathbf{r},\,\frac{d\mathbf{r}}{dt}\right)$:
$\left(\frac{\partial L}{\partial t}\right)_{\mathbf{r},\,\frac{d\mathbf{r}}{dt}}=\frac{dL}{dt}-\frac{d\mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \mathbf{r}}\right)_{t,\frac{d\mathbf{r}}{dt}}-\frac{d^2\mathbf{r}}{dt^2}.\left(\frac{\partial L}{\partial\left( d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}=\frac{d}{dt}\left(L-\frac{d \mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \left(d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}\right)$
The second step requires use of E-L equations. Thus quantity in the brackets on the right is conserved if $\left(\frac{\partial L}{\partial t}\right)_{\mathbf{r},\,\frac{d\mathbf{r}}{dt}}=0$, i.e. if system does not explicitly depend on the time (and is thus invariant under time-translations).
This is true for the free-particle Lagrangian, where the conserved quantity is:
$L-\frac{d \mathbf{r}}{dt}.\left(\frac{\partial L}{\partial \left(d\mathbf{r}/dt\right)}\right)_{t,\mathbf{r}}=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2-\frac{d\mathbf{r}}{dt}.m\frac{d\mathbf{r}}{dt}=-\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$
which is the energy of the system (the sign is due to convention). So let the energy of the free-particle be $U=\frac{1}{2}m\left(\frac{d\mathbf{r}}{dt}\right)^2$. If the energy is changing the change in energy (work) is given by
$\Delta U=\int^{t_2}_{t_1}\frac{dU}{dt} dt=\int^{t_2}_{t_1} \frac{d\mathbf{r}}{dt}.m\frac{d^2\mathbf{r}}{dt^2} dt= \int^{\mathbf{r}_2}_{\mathbf{r}_1} m\frac{d^2\mathbf{r}}{dt^2}.d\mathbf{r}=\int^{\mathbf{r}_2}_{\mathbf{r}_1} \mathbf{F}.d\mathbf{r} $
where $\mathbf{F}$ is the force defined as the rate of change of momentum, which for a free particle is $\mathbf{F}=m\frac{d^2\mathbf{r}}{dt^2}$