[15] Filled code with debug events.

Added helper for event creations.
Minor cleanups.