Fixed some Writer bogosity.

We need to know when the def "header" is done and we're about to encounter
nested defs. Or rather, this simplifies life for the Writer enough that we're
going to burden the caller with it.