make Agent parent of ScriptEngine so they stay on same thread
Merge pull request #2150 from birarda/master

make Agent the parent of its ScriptEngine