Clean up Dictionary.Rules implementation, generalize monad argument to inlining/unfolding rewrites.