Changed browser detection to (hopefully) be more compliant with CommonJS