Feature many many type tables 2

Should fix build problem. The source of this was an @ symbol in the templates that turns off error checking during codegen (plus my mistakes), so I didn't catch the earlier mistake.

Also, this pull request is based on the current 2.2.0 master, so hopefully that works OK.