Upgrade codemirror to 3.18.0
Revamp the timeout mechanism to rely on messages rather than magic variables