make Agent class use common ScriptEngine class