Passing the driver object as an argument

I was previously using the driver as a global object, but I think it's
better to pass it along like this. It certainly cuts down on errors
about undeclared variables.
Exception handling for the current url