Drupal 9-specific modifications, primarily for the change in Event definition but other minor optimisations and fixes.