[PATCH v3 1/5] test/lib: Move screen-scraping setup and layout functions to _ugly files