tests: split out window detection logic
tests: split out window detection logic

For all the focus tests that I'm writing it's useful to have this be
separate so we can just create things by hand, vs spawning a whole
subprocess with new windows and passing the right arguments, etc.

Signed-off-by: Tycho Andersen <6b523322678240882acbb4da5312a12d8cd0082d@tycho.ws>

qtile/qtile,ramnes/qtile,ramnes/qtile,qtile/qtile