Improved event structure design.

The new event design, use less templates, allowing to run without need
of
templates from the server-side. Also the creation of an event is easier
and faster. Handling an event should be o(1).
The main code was changed to reflect test on the new design.