Support where clauses, let bindings and case expressions in case splitting (fixes #395)