Refactor ScriptEngine excecution into sessioned and sessionless operation.