Add full login functionality to app.py.

Add full login/logout/register functionality to app.py with persistent
storage by shelving. Add Register hyperlink to login.html.