Factor-out the detection process into separate file
The process to detect the language of a content referenced by a URL is used in multiple contexts: single, multi and called externally. It makes sense to separate the functionality into its own file (class).