Bug 991167 added BundleEventListener that allow dispatching an event
directly to the UI thread or to the background thread. This patch adds
tests to testEventDispatcher, to test that the events are dispatched on
the correct threads and that the Bundle messages are correct. Because
these events are asynchronous, the test waits for each event to be
processed before continuing.
Make NativeJSContainer/NativeJSObject Java objects own their
corresponding C++ objects directly, to reduce an extra
allocation/deallocation for each object and to simplify code.