Isolated math_parser for various other uses.

Also escaped the math for security.