Closes #3197864
This adds the core_version_requirement for compatibility with drupal 9 and fixes several issues found when passing the code through drupal-check, phpcs and phpunit.
core_version_requirement
drupal-check
phpcs
phpunit