Now create instances in a hook_entity_presave so it runs regardless of how the event is created. Also some cleanup to coding standards