Add a JavaScript view for showing modal dialogs.

RB.DialogView is a wrapper around $.modalBox() that makes it easy to
construct, show, and hide modal dialogs. It can be instantiated and
bound to an element to show the contents of that element as a dialog, or
it can be subclassed to allow another view to act as a dialog.

Reviewed at https://reviews.reviewboard.org/r/6305/
Add a central function for returning the server URL.

We had a lot of code that attempted to build a server URL by fetching a
Site, SiteConfiguration, doing a URL lookup, and building a string. This
was getting silly, so I've added two central functions for this purpose:
get_server_url() and build_server_url().

get_server_url() returns the URL to the root of the server (or a Local
Site, if one of the identifying arguments are provided).

build_server_url() builds a URL off of the server URL. It's a
convenience around calling `urljoin(get_server_url(), ...)`.

Many call sites have been updated to use these new functions. Many still
remain, as we have templates that are building their own URLs, and some
code that's doing fancier URL building, and I didn't want to risk
breaking them right now.

This also fixes a bug with the e-mail headers. We were always referring
to the root of the site, rather than the Local Site, which made it
harder to filter when working on multiple Local Sites.

Reviewed at https://reviews.reviewboard.org/r/6307/