Update Detector.php

Big improvement in class's __construct() method and small improvement in other methods. There is no syntax errors, but I reccomend to write to write tests for it
Merge pull request #1 from VladKamyshanov/master

Update Detector.php