Alter rinari test to avoid error
Implement before and after hooks
Switch to cleaner way of selecting main window

winconfs where the main window is not in the top left corner should
work now.