Refactor Assertions engine + serialize assertions in log, close #2220