Re-order condition that checks for anonymous class

Workaround for ASM 5.0.2 bug that fixes gh-904
Enhance Groovy template support in CLI

to allow user to specify the TemplateEngine

Fixes gh-908