stats: Use statsd client for collecting auth metrics

This switches to using python-statsd for collecting metrics on auth
events.
Add a counter for logout events
Merge pull request #1616 from hypothesis/statsd-client

stats: Use statsd client for collecting auth metrics
Consistency in environment variables
Clear selection when clicking on the adder button.

As discussed in https://github.com/hypothesis/annotator/pull/78.

Fixes https://github.com/hypothesis/h/issues/1598.
Fix link and meta templating

Apparently, tal:repeat and tal:attributes don't really play well
together when I re-use "attrs" or maybe that clashes with some other
key, but this totally works.
Fix resolution of the store config

Fix #1618
Revert "Don't auto-create models in production"

This reverts commit 80cbcac83ca181e2330ae064931e9d831acb7a79.
Move worker count to environment variable

There are problems with races creating databases on startup. We could
stop creating them automatically, but it's mighty convenient and its
not easy to run the db creation script otherwise. For instance, in
a dokku the docker links are not available during the buildstep.
Move button construction out of pluginInit
Move plugin buttons within instance context

This makes it possible to call instance methods on the current plugin
from event handlers, without the additional indirection through
window.annotator.
Simplify setVisibleHighlights function

setVisibleHighlights was previously two methods disguised as one, behind
the "notify" parameter. This commit moves all the code related to
actually changing local state into the onSetVisibleHighlights handler,
making the setVisibleHighlights function responsible solely for firing
the event.
Sort orphan placeholders to bottom of stream
Guest#setVisibleHighlights will always toggle highlights
Merge pull request #1623 from hypothesis/stream-orphan-sort

Sort orphan placeholders to bottom of stream
Merge pull request #1622 from hypothesis/simplify-highlights

Simplify highlight visibility toggling.
Handle undefined data on 'auth' event for AuthAppController

When switching tabs on our /login route, the scope.on 'destroy' is
fired in the AuthController which emits an auth event with undefined
data value.

Our AuthAppController was trying to check the data.userid for this
undefined value. We only need to do that when data is undefined.

Fixes #1627
Move notification related code to a separate directory

Motivation: Make it a compact module, easier to factorize out into
a sepaarate repo later.
DeOOP Notification templates

ReplyTemplate and NotifierTemplates were semi-classes with only a bunch of
static functions collected under a class. Separating the templates in module level
makes these abominations obsolete.
Create reply-notification for newly registered users

This reply-notification-template will be used for the notifier to send replies,
and can be activated/deactivated