Refactor Assertions engine + serialize assertions in log

The refactoring of the main also allows some options combinations that were not possible before, and allows the mute mode to work everywhere.