Rewrite the modcall MOD_* handlers.  Updates #404.

The old code wasn't worth debugging.  With a few hours work,
the new code is simpler, more understandable, and avoids the
bug entirely.