[TIMOB-15257] Custom events missing "type" property

Also refactored the Ti.App module to the new module API.