Restructuring the CakeRequest::is() code and related code a little.