Parses equations and solves them. Based mostly on top-down parser available here: http://effbot.org/zone/simple-top-down-parsing.htm