Introduce template name.
Add evenet dispatching.
Tests for event dispatcher.