Fix arguments to handlers completely wrong #ImAnIdiot

The hooks on the root block that don't take `dir` as their first
argument, many of them take the cursor as their first argument, which is
an object and hence truthy and gets passed to the handler as `dir`,
which is completely wrong.

Closure and check `i` instead, since we know the first 3 handler
names take `dir` and the rest don't, like we did before #349:

https://github.com/mathquill/mathquill/commit/b8f191482b7d310a80c69b6eebacdff85db8eb12#commitcomment-8465453