Refactorings, started ScriptEngine support