Added check for running in a browser and updated lib