Calculate using Katex

Instead of trying to build such a calculator yourself, it’d be a lot easier to just use math.js’ evaluate. Although math.js doesn’t have a KaTeX parser, simple expressions like “1 + 1” in KaTeX is also parseable by math.js. See https://mathjs.org/docs/expressions/syntax.html for math.js’ full syntax.