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

Will allow #7 to be solved in a better manner.

cc @gmalette 
Is it worth having a generic branch for this?