Ability to unsubscribe from notifications

Big PR, sorry for that.

Contents:
- notifier code refactoring (100% backend)
   - All notifier related code (including the domain_mailer) was moved into a separate directory (notification) (bit similar to auth). Will be very easy to factor out into a separate repo later.
   - DeOOP notification templates. The previous solution used classes with ugly static methods. (As @tilgovi said in the past it was overkill). Got rid of them. Every notification template has its own module.
   - Introducing Subscriptions table instead of the UserSubscriptions table (was formerly part of the auth module)
   - notifier fully uses subscriptions table
- Notifications tab for account settings
   - The user accounts now has a notification tab, which displays the notifications and the user can activate/deactivate them.
   - And the backend actually sets the active flag for them. (as @tilgovi suggested)

What's left:
- style the notifications tab
- put the deactivate notification url at the end of the generated emails
- rebasing and squashing the commits and write proper commit messages for them
- add new test cases
- write the migration scripts (which adds the reply notification for all existing users)


<!---
@huboard:{"order":8.71875,"milestone_order":1580,"custom_state":""}
-->

The annotation will not be lost. Elasticsearch is not transactional like
that.

What will be lost is the response and any emails queued for sending.

It might be better to error. The only other thing it would interrupt is
real-time but that will be less coupled to the request success when we
reintroduce it, so I'm not too worried.
On Nov 4, 2014 3:44 AM, "gergely-ujvari" <notifications@github.com> wrote:

> In h/notification/reply_template.py:
>
> > +        if check_conditions(annotation, data):
> > +            try:
> > +                # Render e-mail parts
> > +                tmap = create_template_map(request, annotation, data)
> > +                text = render(TXT_TEMPLATE, tmap, request).strip()
> > +                html = render(HTML_TEMPLATE, tmap, request).strip()
> > +                subject = render(SUBJECT_TEMPLATE, tmap, request).strip()
> > +                recipients = get_recipients(request, data)
> > +                send_email(request, subject, text, html, recipients)
> > +            # ToDo: proper exception handling here
> > +            except TemplateRenderException:
> > +                log.exception('Failed to render subscription'
> > +                              ' template %s', subscription)
> > +            except:
> > +                log.exception('Unknown error when trying to render'
> > +                              ' subscription template %s', subscription)
>
> Yes.
> I agree. We have to do that anyway. But let that be a separate and well
> designed task.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hypothesis/h/pull/1580/files#r19797920>.
>