Generate binomial coefficients with optional memoization. Works in the browser and node.js.