MDL-39959 events: Fixup after review

Code style fixes.
Added validations for various fileds in module created, updated and deleted events.
Added more unit tests to test the added validations.