General purpose resource pooling for node.js