Optimization of generated?

This pull request reorganizes the methods called in `generated?` to only load the data (calls to `lines`) in last resort.
Will this test run if you do `bundle exec ruby test/test/generated.rb`?