Object pooling for the browser and node.js