I'm a first year Maths undergraduate and we have recently gone onto RSA. I understand the majority of the algorithm using Fermat's Theorem etc.
From the algorithm stated on Wikipedia:
4) Choose an integer $d$ such that $1 \lt d \lt φ(n)$ and $\gcd(d, φ(n)) = 1$; i.e., $d$ and $φ(n)$ are coprime.
5) Determine $e$ as $e ≡ d^{−1} \mod {φ(n)}$; i.e., $e$ is the modular multiplicative inverse of $d \mod {φ(n)}$.
I don't understand the importance of $1 < d < φ(n)$.
Also why must the message $M$ to be encrypted be an integer $m$ such that $0 ≤ m < n$ (here $n$ is the product of two distinct primes $p$ and $q$)?