Provide proper previous_view_url for non-root deployments.

SCRIPT_NAME wasn't being taken into account so django.urlresolvers.resolve
could return unexpected matches.

Fixes bug 2767.
Upgrade Select2 to the latest available version.

Includes some nice bugfixes worth incorporating before the actual 3.4
release happens.