When we calculate something "modulo $m$", what we're really doing is arithmetic in the quotient ring $\mathbb Z / m \mathbb Z$, whose elements consist of the congruence classes $[a] := \{a + km \operatorname{|} k \in \mathbb Z\}$, with the arithmetic operations $+$ and $\cdot$ defined on those classes as $[a] + [b] := [a + b]$ and $[a] \cdot [b] := [a \cdot b]$. Given those definitions, we can easily check that they are consistent, in the sense that the values of $[a] + [b]$ and $[a] \cdot [b]$ do not depend on which elements $a$ and $b$ of those congruence classes we choose to represent them.
The catch is that exponentiation is not one of the ring operations defined on $\mathbb Z / m \mathbb Z$; as you've noticed, there's no way to define a binary operator $\land$ on $\mathbb Z / m \mathbb Z$ such that, given two congruence classes $[a]$ and $[b]$ in $\mathbb Z / m \mathbb Z$ and their respective representatives $a$ and $b$, $[a] \land [b] = [a ^ b]$ regardless of the choice of representatives.
Rather, we should view modular exponentiation as a (right) external binary operation on $\mathbb Z / m \mathbb Z$ over $\mathbb Z$, i.e. as a map $\land : (\mathbb Z / m \mathbb Z) \times \mathbb Z \to \mathbb Z / m \mathbb Z$ defined as $[a] \land b = [a]^b := [a^b]$, where $a \in [a] \in \mathbb Z / m \mathbb Z$ and $b \in \mathbb Z$. We can then check that this definition indeed satisfies all the laws we would expect it to, such as, in particular, that $([a]^b)^c = [a]^{b \cdot c}$.
What about Bill Dubuque's answer, then? Well, as he correctly notes, if $p$ is prime (as 17 indeed is), then Fermat's little theorem implies that $[a]^{p-1} = [a]^0 = [1]$ for all $[a] \in \mathbb Z / p \mathbb Z$. Thus, in this case, we may equally well view the exponentiation operator as being defined on $\mathbb Z / p \mathbb Z$ over $\mathbb Z / (p-1) \mathbb Z$. This can simplify calculations, as we may then reduce exponents modulo $p-1$ before applying them.