Drupal 8: Custom AJAX Commands

When changing the ajax responses with hook_ajax_render_alter(), you may sometimes want to add a custom ajax command. Drupal 8 actually supports a plugin-like functionality for it. This functionality needs to be served by a custom module and consists of 2 files - a src/Ajax class and a javascript file implementing the command.