> Wouldn't it be reasonable to start stubbing out the "global state" object and passing that around instead of introducing more shared state? For new code like this, it seems reasonable. But maybe I'm hand-waving.

I'm still unconfortable with performing major changes in the source code. We need a good set of functional tests and reasonable coverage before we start this kind of work.

> Or at the very least, make the module-global variables static.

:+1: