Work on lang def 3.

I'm in the middle of adding mode rules, which will simplify things like strings
or dict syntax, while also allowing for better error messages in case a close
token is missing.