Update tests to fix silently failing test and handle when a module is removed.
This adds a new 'CapabilitiesEventBody' type for having a well structured type for the event and updates the 'restart' request to dynamically set their capabilities.