added basic support for conditions (tests and some helpers)