Working version for the events handling routines.
Added contains() functionality.
Renamed containsChild() to contains()