Moved almost all definitions to services.yml.
Moved the feature to automatically render a template when a controller returns an array to a separate class and event listener.