mat2 for the browser and node.js