Working detectBrowser method and some basic tests