Rewrite 'if' to be recursive instead of table-based.

Will allow #7 to be solved in a better manner.

cc @gmalette