Large all-around changes in the API, putting name fields in each rule declaration.

More changes on the way... Hold still.