Adding support for url to be a proc.

This was useful for our app, so just passing along in case you think others would find it useful. Let me know if you have any feedback or code style change requests.