Refactoring Generators::Base.

The `defaults` hash isn't used unless `class_options.key?(name)` is falsy, so we don't need to compute it unless that same condition is met. 

Also moving some code for extracting a module into its own method.