Fix URLs included in emails when the email is triggered from a script.

Looks like the default host name is '[unknown]' for whatever reason.
Added a check to use "http://openlibrary.org" when web.ctx.home contains
"[unknown]".
cleanup. deleted some unused code.