Corrected positioning of method opening curly bracket (non-functional change)
Added way to provide a callback to handle a rewrite query.

Added CM_WP_Element_Rewrite::handled_by() method to add the callback which saved the callback against the rewrite object & adds the action hook to handle the query.

Also added the InvalidCallbackException for when a non-callable is passed to handled_by().