Second attempt

This attempt has much more readable acceptance tests for the rules, but refactoring towards the end left low coverage of the supporting methods.