Refactoring spellbook view and controller with Foundation.