Combining Painless and Mustache

Yes, this is true, if you need to modify the data structure you want to use in the mustache template, you can use a script to do so, that should work in this case, unless I am missing a requirement.