6d2ba7a75b
This allows to apply the mode atomically and adds possibility of defining custom modes (to be implemented).