ce_base: Added event mask and restructured event definitions; ce_ui: Added event mask checks