Add cascade support

The pull request also includes some refactoring:

* Rule classes are in the `rule` package.
* Public `tags` methods are replaced with `apply`.