composite template DTOs, fix for CustomFields

Hi,

I messed up the last pull request, here is the latest offering only the changes I need.

Thanks, Jason