Fix rules
Refactor rule edit view and controller to be cleaner and more generic
Refactor rule editing