Add expression parsing function.

Supports parentheses and the operations +, -, *, /, and **
(exponentiation) with the usual precedence rules. Detects all malformed
expressions.