Refactor how we extract media types from Accept and Content-Type headers