An improved until  function

Some times "until" returns true but still there is no scope on page. Those changes help avoiding that. 
I also added an helper function that does the same things of visit, without changing the path.