Add if branching, comparisons and other fixes to transpiler