The linear transformation $T:\mathbb R^4\to\mathbb R^4$ is represented by the matrix $M$, where $$
M=\begin{pmatrix}
1&2&0&4\\
5&2&1&-3\\
4&0&1&-7\\
-2&4&-1&\theta
\end{pmatrix}.
$$ It is given that the rank of $M$ is $2$.
(i) Find the value of $\theta$ and state a basis for the range space of $T$. [4]
(ii) Obtain a basis for the null space of $T$. [4]