Refactoring activation_keys edit

This is one for @ehelms. I couldn't make all the instance variables into local
variables because environment selector relies heavily on them unfortunately. We
should probably change that as well though.