Fixed various errors. See full commit message for details.

**Registering new users**
*static/javascripts/authentication/services/authentication.service.js*

It was pointed out by Jason Fehr and Christophe Blefari that the code
for this file was missing some closing curly braces and parentheses.
This has been fixed.

**Registering new users**
*authentication/views.py*

Christophe Blefari noted that `from rest_frameworks import generics`
should be `from rest_framework import generics`

**Logging users in**
*static/javascripts/authentication/services/authentication.service.js*

Christophe Blefari, our observant hero, told us that we put the code for
the logout function where we should have put the code for the login
function. Oops! Fixed that too!