Implement bool expressions

Implements #160.