Added support for running in browser and in node at the same time