Emits and listens for needed events. Removed sample event from index.html.