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 as `dir` to the handler,
which is completely wrong.

Closure and check `i` instead like was done before #349, first 3 handler
names take `dir`, the rest don't.