Move global variable $window to spec_helper.rb + cleanups