The simplest possibility is that those values are included to make the implementation as simple as possible. Namely, the only primitive needed for the exponentiation is Montgomery multiplication.
The core mechanism of Montgomery multiplication is the modular reduction, which consists essentially of Hensel's division method preserving solely the remainder. If you have an odd modulus $n < 2^b$, and some value $x < n^2$, Montgomery reduction computes
$$
\frac{x + n\left(xn' \bmod 2^b\right)}{2^b}\,,
$$
with $n' = -n^{-1} \bmod 2^b$ (the implementation above uses the truncated value $n' = -n^{-1} \bmod 2^{32}$, which is enough for simple quadratic implementations.). This ensures that a) the result is $x2^{-b} \bmod n$, b) the division by $2^b$ is trivial, since $x + n\left(xn' \bmod 2^b\right)$ is a multiple of $2^b$ by design, and c) the result is size-reduced to at most $2n$.
When composing several operations modulo $n$, such as in an exponentiation, it is convenient to put the operands into "Montgomery form", that is $x \mapsto x2^b \bmod n$. This is because Montgomery multiplication will multiply the operands and reduce them using the above trick. So,
$$
\text{MontMul}(x2^b, y2^b) = \frac{x2^b\cdot y2^b}{2^b} \bmod n = xy2^b \bmod n\,,
$$
thus preserving the Montgomery form for the next operation.
There are several ways to convert arguments into Montgomery form. One of them is to compute $x\cdot 2^b \bmod n$ manually, using long division. This is unfortunate, because it will require extra complicated code to perform said division. The alternative is to use Montgomery multiplication itself to compute
$$
\text{MontMul}(x, 2^{2b}) = \frac{x\cdot 2^{2b}}{2^b} \bmod n = x2^b \bmod n\,.
$$
This, however, requires precomputing $2^{2b} \bmod n$ somewhere, which is exactly what the public key format above does.
To convert a value $x2^b \bmod n$ back to normal form, it suffices to multiply it by $1$ using Montgomery multiplication. Or, alternatively, as this implementation does, multiply $x^22^b$ by $x$ to obtain $\frac{x^32^b}{2^b} \bmod n = x^3 \bmod n$.