updating Detector to work with SublimeJS and other contexts