Add support for custom property rules.

Add support for custom property rules and expose a new API to add them. Add test for the built-in custom property rules.