Fixes #6560 - Extract puppet parsing logic

Even though it would be very nice to have optionally enforced interfaces in Ruby, I think it's out of scope for this PR. We need this PR soon, there is no time for adding this. There are also unanswered questions: 
- how to deal with partially implemented classes
- when to consider a class as implemented, it can reopened at any time
- etc.