Added first attempt at defining connections between rules, plus did some code cleanup and updated GUI to account for said fact.