My question is now how to transform this to 2 (and 3) dimensions
I am not sure where your problem is in doing this. In 3 dimensions using
$$\mathbf{x}_1 = \begin{pmatrix}x_1\\y_1\\z_1\end{pmatrix}, \mathbf{x}_2 = \begin{pmatrix}x_2\\y_2\\z_2\end{pmatrix}$$
to denote the position of $m_1$ and $m_2$ respectively, the equations of motion are:
$$m_1\ddot{\mathbf{x}}_1=\mathbf{F}_{21}\\
m_2\ddot{\mathbf{x}}_2=\mathbf{F}_{12}$$
where $\mathbf{F}_{21}$ is the gravitational force of $m_2$ on $m_1$ and $\mathbf{F}_{12}$ is the gravitational force of $m_1$ on $m_2$. Because of Newton's third law, $\mathbf{F}_{21}=-\mathbf{F}_{12}$.
This is a somewhat complicated system of non-linear differential equations. However if you think about the symmetries of the system it should be clear that the motion should not depend on the absolute position of the masses in space but only on their relative position. Mathematically this simplification can be achieved by adding/subtracting the equations from one another. Adding the equations of motions gives:
$$0=m_1\ddot{\mathbf{x}}_1+m_2\ddot{\mathbf{x}}_2= (m_1+m_2)\ddot{\mathbf{R}}$$,
where $\mathbf{R}\equiv (m_1\mathbf{x}_1+m_2\mathbf{x}_2)/(m_1+m_2)$ is the center of mass coordinate. This equation expresses the conservation of momentum.
In the same way for the difference of the coordinates you get the equation of motion:
$$\ddot{\mathbf{r}}\equiv \ddot{\mathbf{x}}_2 - \ddot{\mathbf{x}}_1 = \left(\frac{1}{m_1}+\frac{1}{m_2}\right)\mathbf{F}_{12}$$ which can be rewritten with the reduced mass, $\mu=m_1m_2/(m_1+m_2)$ as
$$\mu\ddot{\mathbf{r}}=\mathbf{F}_{12}=-\frac{Gm_1m_2}{r^2}\hat{\mathbf{r}}$$
where $r=|\mathbf{r}|$ is the distance between the masses and $\hat{\mathbf{r}}=\mathbf{r}/r$ is the unit vector in the direction of $\mathbf{r}$. This equation is the starting point for the discussion/calculation of the motion.
Outline of solution
Finding a general analytical solution for $\mathbf{r}(t)$ is difficult (impossibe or at least ugly requiring special functions?). Still you can get many important results without this solution.
Using symmetry or angular momentum conservation you can argue that the motion will be in a plane (set by the initial velocity vectors), so that the problem simplifies to a two dimensional problem.
Since the force is radial it makes sense to solve the problem in polar coordinate:
$$\mathbf{r}=r\begin{pmatrix}\cos\theta\\ \sin\theta\end{pmatrix}$$
Even then solving the problem is hard work. The classical method is to substitute $u=1/r$ and to look for solutions for $u(\theta)$. You might want to look up Binet equation.