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, first 3 handler names take `dir`, the
rest don't.