Better caret escape

This PR expands the escape of carets (signifying exponents) in math expressions to handle bases and exponents within parentheses.

Probably in the long term we may want to switch to SymPy, which should be handle this syntax but in the mean time it allows expressions imported directly from NMODL to be parsed.