[Runtime] Add runtime model event core classes

There are two event types for runtime model which are different from ordinary
DOM events(see http://www.w3.org/2012/sysapps/app-lifecycle): application
events which are events send to application indicate what’s happening to the
application, like launch, terminate, suspend and etc; system events which are
events sent by the system, a system event can wake up a terminated application.
This patch introduces some core classes to register and handling such events.

EventHandler is the handler abstraction class owned by ApplicationEventRouter.
It can be created on any thread, the event handler callback will be scheduled by
ApplicationEventRouter and called on the creation thread.
ApplicationEventRouter is the key class to dispatch event to different handlers.
AppEventRegistrar is a helper class for event handling classes to add/remove
event handlers.