Refactor Request::is() and add tests