[lua-classconversion] Smarter converter with templating