#60 Improved generated code for types

Implemented a more consistent newline policy. Fixes #60