Add letfn test for interdependent bindings
Override booleanCast to be more permissive.

Some other minor refactorings.