Big commit: Completed functionality to add and remove rules via the UI.