Mostly undone restructuring of code generatio for closures.

The too liberal typing of the "body" argument remains and an extra case
has been added.