Make the library compatible with both Nodejs and in-browser javascript