Support hosting under a domain subpath (eg. example.org/bookie)

This adds support for hosting Bookie on a subdomain. Some things still
don't work quite right (ie. sometimes the slash after `bookie` in
`example.org.bookie` is lost) but that's not frequent enough to be a
blocker in my opinion.

We have been using this in production for months without much problem
except the above now.