Added javascript reference counting and cleanup for objects wrapped by JSObject.