Fixed  `start_url` processing issues (closes #201)

* added document URL as arg to the algorithm.
* If the URL is the empty string or undefined, then it should return
the URL of the top-level browsing context.
* If the URL is in error, it should return the URL of the top-level
browsing context.