First working version of event manager.

Experimenting with plain script and class.