Code generation of toString() (merge with master)