fixed bug caught by unit tests
I mistakenly used `ctx.Writer` instead of `writer` in `writeModuleHeader` and `writeTypeHeader`.
added BlankLines.Default and made None be no blank lines