Monotonic

Add support for querying expressions for monotonicity, and a few optimizations based on these queries.

Closes #38.