[Runtime] Add application event extension support

Currently application event extension API follows Chrome.events definition
(https://developer.chrome.com/apps/events.html).

Implementation details:
The event extension is implemented as an internal extension running on UI
thread. Its instance implements application::EventObserver interface to observe
registered events.

When a listener of an event is added for the first time, the extension instance
will save the wrapped dispatchEvent callback. Then when such event is notified,
the extension instance will call the wrapped callback to run all added
listeners.
When all listeners are removed from an event, the extension instance will detach
itself from the event through event manager, the corresponding saved callback
will also be removed.

To provide a method to get the event dispatching status an event type prefix
with
"onDispatchEventFinish_xxx" is introduced. Other observers can attach to such
events and get notification when "xxx" event has finished its dispatching in JS.
[Runtime] Add application event API browser test