YARD friendly code generation

@jarib Specs now pass. I had to remove some attributes from generated interfaces because they overwrite some element methods. Please, review code.
Looks like this special handling of `for` is no longer needed - just let it fall through to the else.