Refactored the new event bus API.
Separated event framework into public API and internal parts