First version with tests for browser and node