This is a longstanding bug, so I'm glad its fixed, even if its only a
bandaid.
This does break some tests, but I'm too tired and these tests are out of
date.
This required a massive cross-cutting rework to the scope system,
multiple subtle bugfixes and relearning of the parser internals, but it
does appear that functions are working correctly.
A few caveats: for now, parameters are always constant, regardless of
type, return values can't be specified, and some script tests have been
written.
Most importantly, a key feature is working: closures.