Make package work for browser and node