Added a lot more rules/helpers, and added a bunch of tests.