Add JavaScript support for application Event object

An application event is an event send to application and will be handled by main
document. An system event is event sent by the system and can wake up a
terminated application. They're different from normal DOM event which originated
from the DOM element. The application event API will provides an interface to
add/remove listeners which will be called when such event happens.

Currently the application Event object support is an implementation of
chrome.events.Event API(https://developer.chrome.com/apps/events.html) subset.
Event.addListener, Event.removeListener, Event.hasListener and
Event.hasListeners APIs are supported.