Implemented events instead of callbacks, full example in events.html

Conflicts:
	examples/events.html