Speedup for non-windows, fixes.

Set up a TPP with these scripts, seemed to need some small fixes.

See commit comments for details.
Yeah if the window is already there there's no reason to search for it on each `sendKey()`