Ruletest

This is an early draft, mostly looking for comments and corrections.