Why is dU an exact differential and dq an inexact differential? dU, dG, dH etc are all exact differentials and the variables themselves are known as state functions because they only depend on the state of the system. However, dq and dw for example, are inexact differentials. My questions is, what does this actually mean? I've been told that exact differentials are not dependent on the path (what does 'path' mean?) but inexact differentials are. I have been told this is related to line integrals but I am not sure how. Also is this relevant?
As opposed to an exact differential, an inexact differential cannot be expressed as the differential of a function, i.e. while there exist a function $U$ such that $U = \int \mathrm{d} U$, there is no such functions for $\text{đ} q$ and $\text{đ} w$.
And the same is, of course, true for any state function $a$ and any path function $b$ respectively: an infinitesimal change in a state function is represented by an exact differential $\mathrm{d} a$ and there is a function $a$ such that $a = \int \mathrm{d} a$, while an infinitesimal change in a path function $b$ is represented by an inexact differential $\text{đ} b$ and there is no function $b$ such that $b = \int \text{đ} b$.

Consequently, for a process in which a system goes from state $1$ to state $2$ a change in a state function $a$ can be evaluated simply as
$$\int_{1}^{2} \mathrm{d} a = a_{2} - a_{1} \, ,$$ 
while a change in a path function $b$ can not be evaluated in such a simple way,
$$\int_{1}^{2} \text{đ} b \neq b_{2} - b_{1} \, .$$
And for a state function $a$ in a thermodynamic cycle
$$\oint \mathrm{d} a = 0 \, ,$$
while for a path function $b$
$$\oint \text{đ} b \neq 0 \, .$$
The last mathematical relations are important, for instance, for the first law of thermodynamics, because while $\oint \text{đ} q \neq 0$ and $\oint \text{đ} w \neq 0$ it was experimentally found that $\oint (\text{đ} q + \text{đ} w) = 0$ for a closed system, which implies that there exist a state function $U$ such that $\mathrm{d} U = \text{đ} q + \text{đ} w$.