Integrate third party auth into the combined login/registration page.

Changes:

* Change third party auth login failure code to a 401, to detect authentication success with no linked account.
* If already authenticated, redirect immediately to the dashboard.
* Use "Location" header correctly for 302 redirects from student views.
* Add utility functions for simulating a running third-party auth pipeline.
* Add a utility function for checking whether third party auth is enabled.

Not yet implemented (mostly to avoid merge conflicts with the other JS work):

* i18n for JavaScript templates
* Proper error messaging in JS
* Default values in registration form if shared by the third party auth provider (Python handles this, but the JS doesn't yet display it)
* JS tests

Reviewers: @stephensanchez @dianakhuang 
FYI: @rlucioni @AlasdairSwan 
Nice catch.