Remove some code duplication
Added close option for withWindow()
GEB-258: set default value for close option in withNewWindow() to 'true' as specified in the manual