Added support for registering rewrite rules.

Next step is to add the is_handled_by() method to allow automatic handler callback calling.