added if function with tests.

Wondered if you might be interested in this:

* Added an if function with tests.
* the library is available in all tests