Modernise rule management; various ui changes, some refactoring.