Plug some leaks in TestController and UIScriptContext.