renamed is_www to is_url
New function write() for generating a string representation of the url with flags that allow output of scheme and host relative urls