Here's a first stab at an effect-monomorphic typechecker.

I haven't added polymorphic functions yet, so the only thing which needs
unification is existential type variables in commands or konstructors,
which get skolemized in the corresponding patterns.

In a moment of clarity, I realised that the continuation in a function's
command-pattern should allow its argument to do whatever the function can
do: it will be the function that calls the continuation.