Revamp layout detection.
Revamp layout detection.

There are a lot of changes here, as I just fiddled with things until
it worked.  I had to make some pretty deep modifications.  Among them:

1. Layout contexts are now consistently added at the next token AFTER
   the introducing keyword.
2. Resolution of bracket nesting now happens in the layout scanner, not
   the token parser.
3. The whole notion of layout scan state was replaced by remembering
   the last two tokens.  The meaning is handled on the fly.
4. I recombined brackets and layout contexts into one stack.  This
   turns out to be crucial, because brackets can be used to limit the
   scope of a layout context (e.g., by placing an entire do-block in
   parentheses).

FYI @nixorn

alphalambda/codeworld,pranjaltale16/codeworld,pranjaltale16/codeworld,pranjaltale16/codeworld,alphalambda/codeworld,alphalambda/codeworld,google/codeworld,google/codeworld,google/codeworld