Marked version.
* Proper locking.
* Moved code (a lot).
Improved a code little.
This piece is not needed.
Lock free events.
Added comment.
Merge branch 'events-fix-hashtable'