ACT-1858: caching of ScriptEngine instances + groovy optimalisation