Implemented if / then / else.

Also fixed bug with closures being calculated correctly.