Replace use of instance variables with local variables.

See commits - there are still a couple of instance variables that don't appear to be used. However, I believe investigating the removal of these is outside the scope of this assignment since they are not in the controller (and our task was focused on refactoring the controller) -- we already introduced a number of changes that might be considered "extra" anyway.